internal/web/templates/login.html

34 lines · 1620 bytes

 1{{define "width"}}bounded{{end}}
 2{{define "title"}}login · {{.Site}}{{end}}
 3{{define "content"}}
 4<h1>Sign in</h1>
 5{{if .Next}}<p class="meta">Sign in to continue to <code>{{.Next}}</code>.</p>{{end}}
 6{{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}}
 7{{if .Sent}}
 8<p>If that account exists, a login link is on its way. It works once and
 9expires in fifteen minutes.</p>
10{{else}}
11{{if .EmailLogin}}
12<form method="post" action="/login">
13  <div class="field"><label for="identifier">Username or email address</label>
14  <input type="text" id="identifier" name="identifier" autocomplete="username" required></div>
15  <button type="submit">Email me a link</button>
16</form>
17<p>Or, from a machine with your registered key:</p>
18{{else}}
19<p>Browser sessions are minted over SSH — there is no password. From a machine
20with your registered key:</p>
21{{end}}
22<pre class="message">ssh git@{{.Host}} web login</pre>
23<p>then open the printed URL within five minutes.</p>
24{{end}}
25<h2>New here?</h2>
26{{if eq .Mode "open"}}<p><a href="/register">Create an account</a> — pick a username, paste your SSH
27public key, verify your email. Or from the terminal:</p>
28<pre class="message">ssh git@{{.Host}} register --username you --email you@example.org</pre>
29{{else if eq .Mode "invite"}}<p>This instance is invite-only. With a code from an admin,
30<a href="/register">create an account</a> — pick a username, paste your SSH public key. Or from
31the terminal:</p>
32<pre class="message">ssh git@{{.Host}} register --username you --invite &lt;code&gt;</pre>
33{{else}}<p>This instance is not accepting new accounts.</p>{{end}}
34{{end}}