diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-11 17:20:39 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-11 17:20:39 +0100 |
commit | f5c307668c7fa3c367defc6e924d7c1e00303c16 (patch) | |
tree | c1de4e00504e6c570204852a6752e11938cb2c0c /templates/login.qtpl | |
parent | 1e45ae2ea3497958b2ea6a20137955cfc3bbc964 (diff) | |
download | cerrado-f5c307668c7fa3c367defc6e924d7c1e00303c16.tar.gz cerrado-f5c307668c7fa3c367defc6e924d7c1e00303c16.tar.bz2 cerrado-f5c307668c7fa3c367defc6e924d7c1e00303c16.zip |
feat: Add login redirect
Now login will return to page before the user clicked on login
Diffstat (limited to 'templates/login.qtpl')
-rw-r--r-- | templates/login.qtpl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/templates/login.qtpl b/templates/login.qtpl index 7815bd7..efaf329 100644 --- a/templates/login.qtpl +++ b/templates/login.qtpl @@ -2,6 +2,7 @@ {% code type LoginPage struct { + Referer string ErrorMessage string } %} @@ -13,7 +14,11 @@ type LoginPage struct { {% func (p *LoginPage) Content(ctx context.Context) %} <div class="row"> <div class="col-md-6 offset-md-3"> + {% if p.Referer == "" %} <form action="/login/" method="POST"> + {% else %} + <form action="/login/?referer={%s p.Referer %}" method="POST"> + {% endif %} <div class="form-group m-3"> <label for="username" class="form-label">Username</label> <input type="text" class="form-control" name="username" id="username"> |