feat: SSR 忘记密码与 Admin SMTP 设置
邮箱验证码重置密码(吊销 session);后台可配 SMTP 并发送测试信。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
33
templates/auth/forgot_password.tmpl
Normal file
33
templates/auth/forgot_password.tmpl
Normal file
@@ -0,0 +1,33 @@
|
||||
{{define "auth/forgot_password"}}
|
||||
{{template "base/head" .}}
|
||||
<main class="j13-main j13-main--solo j13-auth">
|
||||
<h1>忘记密码</h1>
|
||||
{{template "base/alert" .}}
|
||||
{{if .MailReady}}
|
||||
<form method="post" action="/forgot-password" class="j13-form" id="forgot-form">
|
||||
<input type="hidden" name="_csrf" value="{{.CSRF}}"/>
|
||||
<label>注册邮箱
|
||||
<input type="email" name="email" required autocomplete="email" value="{{.Email}}"/>
|
||||
</label>
|
||||
<label>邮箱验证码
|
||||
<div class="j13-form__row">
|
||||
<input name="email_code" required inputmode="numeric" autocomplete="one-time-code" maxlength="8"/>
|
||||
<button type="submit" formaction="/forgot-password/send-code" formnovalidate class="j13-btn-secondary">发送验证码</button>
|
||||
</div>
|
||||
</label>
|
||||
<label>新密码
|
||||
<input type="password" name="new_password" required autocomplete="new-password" minlength="6"/>
|
||||
</label>
|
||||
<label>确认新密码
|
||||
<input type="password" name="new_password2" required autocomplete="new-password" minlength="6"/>
|
||||
</label>
|
||||
<button type="submit">重置密码</button>
|
||||
</form>
|
||||
<p class="j13-muted">若该邮箱已注册,验证码将发送到邮箱。重置后其它设备会话将失效。</p>
|
||||
{{else}}
|
||||
<p class="j13-muted">邮件服务未配置,无法通过邮箱重置密码。请联系站长在后台配置 SMTP,或使用其它方式找回。</p>
|
||||
{{end}}
|
||||
<p><a href="/login">返回登录</a> · <a href="/">返回首页</a></p>
|
||||
</main>
|
||||
{{template "base/footer" .}}
|
||||
{{end}}
|
||||
@@ -14,7 +14,7 @@
|
||||
</label>
|
||||
<button type="submit">登录</button>
|
||||
</form>
|
||||
<p><a href="/register">没有账号?注册</a> · <a href="/">返回首页</a></p>
|
||||
<p><a href="/register">没有账号?注册</a> · <a href="/forgot-password">忘记密码</a> · <a href="/">返回首页</a></p>
|
||||
</main>
|
||||
{{template "base/footer" .}}
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user