1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00
miniflux-v2/internal/template/templates/views/login.html
Frédéric Guillot 51030ef1a8 feat(webauthn): show help message regarding username and non-discoverable credentials
The username is required for non-resident keys, but it's not necessary for discoverable credentials like Passkeys.
2024-10-26 21:49:23 -07:00

62 lines
2.4 KiB
HTML

{{ define "title"}}{{ t "page.login.title" }}{{ end }}
{{ define "page_header"}}{{ end }}
{{ define "content"}}
<section class="login-form">
{{ if not disableLocalAuth }}
<form action="{{ route "checkLogin" }}" method="post">
<input type="hidden" name="csrf" value="{{ .csrf }}">
{{ if .errorMessage }}
<div role="alert" class="alert alert-error">{{ .errorMessage }}</div>
{{ end }}
<label for="form-username">{{ t "form.user.label.username" }}</label>
<input type="text" name="username" id="form-username" value="{{ .form.Username }}" autocomplete="username" required autofocus>
<label for="form-password">{{ t "form.user.label.password" }}</label>
<input type="password" name="password" id="form-password" value="{{ .form.Password }}" autocomplete="current-password" required>
<div class="buttons">
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.loading" }}">{{ t "action.login" }}</button>
</div>
</form>
{{ end }}
{{ if and (not disableLocalAuth) (.webAuthnEnabled) }}
<hr>
{{ end }}
{{ if .webAuthnEnabled }}
<div class="webauthn">
<template id="webauthn-error">
<div role="alert" class="alert alert-error" id="webauthn-error-alert">
<h4>{{ t "page.login.webauthn_login.error" }}</h4>
<p id="webauthn-error-message"></p>
</div>
</template>
<div class="buttons">
<button class="button button-primary" id="webauthn-login" disabled>{{ t "page.login.webauthn_login" }}</button>
</div>
<div class="form-help">
<p>{{ t "page.login.webauthn_login.help" }}</p>
</div>
</div>
{{ end }}
{{ if and (.webAuthnEnabled) (or (hasOAuth2Provider "google") (hasOAuth2Provider "oidc")) }}
<hr>
{{ end }}
{{ if hasOAuth2Provider "google" }}
<div class="oauth2">
<a href="{{ route "oauth2Redirect" "provider" "google" }}">{{ t "page.login.google_signin" }}</a>
</div>
{{ else if hasOAuth2Provider "oidc" }}
<div class="oauth2">
<a href="{{ route "oauth2Redirect" "provider" "oidc" }}">{{ t "page.login.oidc_signin" oidcProviderName }}</a>
</div>
{{ end }}
</section>
<footer id="prompt-home-screen">
<button id="btn-add-to-home-screen">{{ icon "home" }}<span class="icon-label">{{ t "action.home_screen" }}</span></button>
</footer>
{{ end }}