| 1 | {{define "title"}}{{if .State.Unavailable}}Base{{else}}Sign in to {{.Name}}{{end}}{{end}} |
| 2 | {{define "main"}}{{$s := .State}}<main class="signin"> |
| 3 | <div class="card glass"> |
| 4 | <div class="wordmark">base</div> |
| 5 | {{if eq $s.Step "continue"}}<meta http-equiv="refresh" content="0;url={{$s.ContinueURL}}"> |
| 6 | <h2>Taking you to Keymail</h2> |
| 7 | <p>Taking you to Keymail to confirm it's you.</p> |
| 8 | <a class="btn" href="{{$s.ContinueURL}}">Continue to Keymail</a> |
| 9 | {{else if eq $s.Step "sent"}}<h2>Check your email</h2> |
| 10 | <p>{{if $s.SentTo}}We sent a link to <bdi>{{$s.SentTo}}</bdi>.{{else}}We sent a link to your inbox.{{end}} The link works once and expires soon.</p> |
| 11 | <form method="post" action="{{$s.ForgetPath}}">{{with $s.ReturnTo}}<input type="hidden" name="return_to" value="{{.}}">{{end}}<button class="btn ghost" type="submit">Use a different email</button></form> |
| 12 | {{else}}<h2>Sign in to {{.Name}}</h2> |
| 13 | {{if .Refused}}<p role="status">Sign-in isn't available for that address. Ask whoever runs {{.Name}} to invite you, or try another address.</p> |
| 14 | {{else if $s.Problem}}<p role="status">{{.ProblemText}}</p> |
| 15 | {{else if .Linking}}<p>To connect your Oficina account, sign in with your email.</p> |
| 16 | {{else if not .Oficina}}<p>Use your work email.</p> |
| 17 | {{end}}{{with .Oficina}}<a class="btn full" href="{{.}}">Sign in with Oficina</a> |
| 18 | <p class="or">Or use your work email.</p> |
| 19 | {{end}}<form method="post" action="{{$s.BeginPath}}"{{with $s.Proof}} {{.Attrs}}{{end}}>{{with $s.Proof}}{{.Fields}}{{end}} |
| 20 | {{with $s.ReturnTo}}<input type="hidden" name="return_to" value="{{.}}"> |
| 21 | {{end}}{{if or $s.Force (eq $s.Problem "keymail")}}<input type="hidden" name="force" value="1"> |
| 22 | {{end}}<input class="input" type="email" name="address" value="{{$s.Address}}" autocomplete="email" required aria-label="Email address"> |
| 23 | <button class="btn{{if .Oficina}} ghost{{end}}" type="submit">{{if eq $s.Problem "keymail"}}Send me a link instead{{else}}Continue{{end}}</button> |
| 24 | </form> |
| 25 | {{with $s.Passkey}}{{/* Hidden until rastrillo's door script finds the browser can run a passkey ceremony, so with scripts off there is no dead button. */}}<button class="alt" type="button" hidden data-rst-passkey data-rst-passkey-begin="{{.BeginPath}}" data-rst-passkey-finish="{{$s.PasskeyFinish}}" data-rst-passkey-module="{{.ModuleURL}}" data-rst-passkey-cancelled="No passkey was used. Try again, or use your email." data-rst-passkey-failed="That didn't work. Try again, or use your email." aria-describedby="passkey-msg">Or use a passkey</button> |
| 26 | <p class="passkey-msg" id="passkey-msg" aria-live="polite"></p> |
| 27 | <script type="module" src="{{.ScriptURL}}"></script> |
| 28 | {{end}}{{end}}</div> |
| 29 | </main>{{end}} |
| 30 | |