| 1 |
{{ define "title"}}{{ t "page.login.title" }}{{ end }} |
| 2 |
|
| 3 |
|
| 4 |
{{ define "page_header"}}{{ end }} |
| 5 |
|
| 6 |
{{ define "content"}} |
| 7 |
<section class="login-form"> |
| 8 |
{{ if not disableLocalAuth }} |
| 9 |
<form action="{{ routePath "/login" }}" method="post"> |
| 10 |
<input type="hidden" name="csrf" value="{{ .csrf }}"> |
| 11 |
<input type="hidden" name="redirect_url" value="{{ .redirectURL }}"> |
| 12 |
|
| 13 |
{{ if .errorMessage }} |
| 14 |
<div role="alert" class="alert alert-error">{{ .errorMessage }}</div> |
| 15 |
{{ end }} |
| 16 |
|
| 17 |
<label for="form-username">{{ t "form.user.label.username" }}</label> |
| 18 |
<input type="text" name="username" id="form-username" value="{{ .form.Username }}" autocomplete="username webauthn" required autofocus> |
| 19 |
|
| 20 |
<label for="form-password">{{ t "form.user.label.password" }}</label> |
| 21 |
<input type="password" name="password" id="form-password" value="{{ .form.Password }}" autocomplete="current-password" required> |
| 22 |
|
| 23 |
<div class="buttons"> |
| 24 |
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.loading" }}">{{ t "action.login" }}</button> |
| 25 |
</div> |
| 26 |
</form> |
| 27 |
{{ end }} |
| 28 |
{{ if and (not disableLocalAuth) (.webAuthnEnabled) }} |
| 29 |
<hr> |
| 30 |
{{ end }} |
| 31 |
{{ if .webAuthnEnabled }} |
| 32 |
<div class="webauthn"> |
| 33 |
<template id="webauthn-error"> |
| 34 |
<div role="alert" class="alert alert-error" id="webauthn-error-alert"> |
| 35 |
<h4>{{ t "page.login.webauthn_login.error" }}</h4> |
| 36 |
<p id="webauthn-error-message"></p> |
| 37 |
</div> |
| 38 |
</template> |
| 39 |
<div class="buttons"> |
| 40 |
<button class="button button-primary" id="webauthn-login" disabled>{{ t "page.login.webauthn_login" }}</button> |
| 41 |
</div> |
| 42 |
</div> |
| 43 |
{{ end }} |
| 44 |
{{ if and (.webAuthnEnabled) (or (hasOAuth2Provider "google") (hasOAuth2Provider "oidc")) }} |
| 45 |
<hr> |
| 46 |
{{ end }} |
| 47 |
{{ if hasOAuth2Provider "google" }} |
| 48 |
<div class="oauth2"> |
| 49 |
<a href="{{ routePath "/oauth2/%s/redirect" "google" }}">{{ t "page.login.google_signin" }}</a> |
| 50 |
</div> |
| 51 |
{{ else if hasOAuth2Provider "oidc" }} |
| 52 |
<div class="oauth2"> |
| 53 |
<a href="{{ routePath "/oauth2/%s/redirect" "oidc" }}">{{ t "page.login.oidc_signin" oidcProviderName }}</a> |
| 54 |
</div> |
| 55 |
{{ end }} |
| 56 |
</section> |
| 57 |
<footer id="prompt-home-screen"> |
| 58 |
<button id="btn-add-to-home-screen">{{ icon "home" }}<span class="icon-label">{{ t "action.home_screen" }}</span></button> |
| 59 |
</footer> |
| 60 |
{{ end }} |