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