This adds a self-serve password reset page. Users can enter their username and receive an email with a link that will let them create a new password. If they've never set a password, it will send them a one-time login link (building on #776) that will then take them to their Account Settings page. If they don't have an email associated with their account, they'll be instructed to contact the admin, so they can manually reset the password. Includes changes to the stylesheet and database, so run: make ui writefreely db migrate Closes T508
40 lines
1.5 KiB
Cheetah
40 lines
1.5 KiB
Cheetah
{{define "head"}}<title>Log in — {{.SiteName}}</title>
|
|
<meta name="description" content="Log in to {{.SiteName}}.">
|
|
<meta itemprop="description" content="Log in to {{.SiteName}}.">
|
|
<style>
|
|
input{margin-bottom:0.5em;}
|
|
p.forgot {
|
|
font-size: 0.86em;
|
|
}
|
|
</style>
|
|
{{end}}
|
|
{{define "content"}}
|
|
<div class="tight content-container">
|
|
<h1>Log in to {{.SiteName}}</h1>
|
|
|
|
{{if .Flashes}}<ul class="errors">
|
|
{{range .Flashes}}<li class="urgent">{{.}}</li>{{end}}
|
|
</ul>{{end}}
|
|
|
|
{{template "oauth-buttons" .}}
|
|
|
|
{{if not .DisablePasswordAuth}}
|
|
<form action="/auth/login" method="post" style="text-align: center;margin-top:1em;" onsubmit="disableSubmit()">
|
|
<input type="text" name="alias" placeholder="Username" value="{{.LoginUsername}}" {{if not .LoginUsername}}autofocus{{end}} /><br />
|
|
<input type="password" name="pass" placeholder="Password" {{if .LoginUsername}}autofocus{{end}} /><br />
|
|
<p class="forgot"><a href="/reset">Forgot password?</a></p>
|
|
{{if .To}}<input type="hidden" name="to" value="{{.To}}" />{{end}}
|
|
<input type="submit" id="btn-login" value="Login" />
|
|
</form>
|
|
|
|
{{if and (not .SingleUser) .OpenRegistration}}<p style="text-align:center;font-size:0.9em;margin:3em auto;max-width:26em;">{{if .Message}}{{.Message}}{{else}}<em>No account yet?</em> <a href="{{.SignupPath}}">Sign up</a> to start a blog.{{end}}</p>{{end}}
|
|
|
|
<script type="text/javascript">
|
|
function disableSubmit() {
|
|
var $btn = document.getElementById("btn-login");
|
|
$btn.value = "Logging in...";
|
|
$btn.disabled = true;
|
|
}
|
|
</script>
|
|
{{end}}
|
|
{{end}}
|