summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAJ ONeal <coolaj86@gmail.com>2019-04-18 01:23:59 -0600
committerLauris BH <lauris@nix.lv>2019-04-18 10:23:59 +0300
commit6dbd26185203d464c4a4e32e7af04a34f37ae4f2 (patch)
treea637798c309f188ffb8abed5716b2fa03e5cb937 /templates
parentfdb933cd67c10c6860ba39402f4b266a9f198f72 (diff)
downloadgitea-6dbd26185203d464c4a4e32e7af04a34f37ae4f2.tar.gz
gitea-6dbd26185203d464c4a4e32e7af04a34f37ae4f2.zip
UX + Security current user password reset (#5042)
* allow current user to reset their own password * handle reset password edge cases properly and consistently * remove dangling assignment * properly label account recovery instead of reset password * remove 'Click here' from button * update English-only account-recovery templates
Diffstat (limited to 'templates')
-rw-r--r--templates/mail/auth/register_notify.tmpl2
-rw-r--r--templates/mail/auth/reset_passwd.tmpl7
-rw-r--r--templates/user/auth/reset_passwd.tmpl15
3 files changed, 20 insertions, 4 deletions
diff --git a/templates/mail/auth/register_notify.tmpl b/templates/mail/auth/register_notify.tmpl
index 4ee25329c4..ea1857030a 100644
--- a/templates/mail/auth/register_notify.tmpl
+++ b/templates/mail/auth/register_notify.tmpl
@@ -9,7 +9,7 @@
<p>Hi <b>{{.DisplayName}}</b>, this is your registration confirmation email for {{AppName}}!</p>
<p>You can now login via username: {{.Username}}.</p>
<p><a href="{{AppUrl}}user/login">{{AppUrl}}user/login</a></p>
- <p>If this account has been created for you, please <a href="{{AppUrl}}user/forgot_password">reset your password</a> first.</p>
+ <p>If this account has been created for you, please <a href="{{AppUrl}}user/forgot_password">set your password</a> first.</p>
<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
</body>
</html>
diff --git a/templates/mail/auth/reset_passwd.tmpl b/templates/mail/auth/reset_passwd.tmpl
index 5fb98c7819..e01d57cea2 100644
--- a/templates/mail/auth/reset_passwd.tmpl
+++ b/templates/mail/auth/reset_passwd.tmpl
@@ -2,13 +2,14 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>{{.DisplayName}}, you have requested to reset your password</title>
+ <title>{{.DisplayName}}, you have requested to recover your account</title>
</head>
<body>
<p>Hi <b>{{.DisplayName}}</b>,</p>
- <p>Please click the following link to reset your password within <b>{{.ResetPwdCodeLives}}</b>:</p>
- <p><a href="{{AppUrl}}user/reset_password?code={{.Code}}">{{AppUrl}}user/reset_password?code={{.Code}}</a></p>
+ <p>Please click the following link to recover your account within <b>{{.ResetPwdCodeLives}}</b>:</p>
+
+ <p><a href="{{AppUrl}}user/recover_account?code={{.Code}}">{{AppUrl}}user/recover_account?code={{.Code}}</a></p>
<p>Not working? Try copying and pasting it to your browser.</p>
<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
</body>
diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl
index 19a7c8eea8..e7d939294e 100644
--- a/templates/user/auth/reset_passwd.tmpl
+++ b/templates/user/auth/reset_passwd.tmpl
@@ -10,11 +10,26 @@
</h2>
<div class="ui attached segment">
{{template "base/alert" .}}
+ {{if .user_email }}
+ <div class="inline field">
+ <label for="user_name">{{.i18n.Tr "email"}}</label>
+ <input id="user_name" type="text" value="{{ .user_email }}" disabled>
+ </div>
+ {{end}}
{{if .IsResetForm}}
<div class="required inline field {{if .Err_Password}}error{{end}}">
<label for="password">{{.i18n.Tr "password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" autofocus required>
</div>
+ {{if not .user_signed_in}}
+ <div class="inline field">
+ <label></label>
+ <div class="ui checkbox">
+ <label>{{.i18n.Tr "auth.remember_me"}}</label>
+ <input name="remember" type="checkbox">
+ </div>
+ </div>
+ {{end}}
<div class="ui divider"></div>
<div class="inline field">
<label></label>