124 lines
7.8 KiB
Plaintext
124 lines
7.8 KiB
Plaintext
<#import "template.ftl" as layout>
|
|
<@layout.registrationLayout displayMessage=!messagesPerField.existsError('username','password') displayInfo=realm.password && realm.registrationAllowed && !registrationDisabled??; section>
|
|
<#if section = "header">
|
|
<#-- Logo is added via CSS ::before pseudo-element -->
|
|
<#if auth.attemptedUsername?has_content>
|
|
<#-- Password step: show username in disabled field with back arrow -->
|
|
<#else>
|
|
<h1 id="kc-page-title">${msg("loginAccountTitle")}</h1>
|
|
</#if>
|
|
<#elseif section = "form">
|
|
<div id="kc-form">
|
|
<div id="kc-form-wrapper">
|
|
<#if realm.password>
|
|
<form id="kc-form-login" onsubmit="login.disabled = true; return true;" action="${url.loginAction}" method="post">
|
|
<#if auth.attemptedUsername?has_content>
|
|
<#-- Password step: show username as disabled input with back link in label -->
|
|
<div class="form-group">
|
|
<div class="label-with-action">
|
|
<label for="username-display" class="pf-c-form__label pf-c-form__label-text">${msg("username")}</label>
|
|
<a href="${url.loginRestartFlowUrl}" class="change-username-link" aria-label="${msg("restartLoginTooltip")}" title="${msg("restartLoginTooltip")}">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/>
|
|
<path d="m15 5 4 4"/>
|
|
</svg>
|
|
<span>${msg("doChange")}</span>
|
|
</a>
|
|
</div>
|
|
<input type="text" id="username-display" class="pf-c-form-control" value="${auth.attemptedUsername}" disabled readonly />
|
|
</div>
|
|
<#else>
|
|
<#-- Username step -->
|
|
<#if !usernameHidden??>
|
|
<div class="form-group">
|
|
<label for="username" class="pf-c-form__label pf-c-form__label-text">
|
|
<#if !realm.loginWithEmailAllowed>${msg("username")}<#elseif !realm.registrationEmailAsUsername>${msg("usernameOrEmail")}<#else>${msg("email")}</#if>
|
|
</label>
|
|
<input tabindex="1" id="username" class="pf-c-form-control" name="username" value="${(login.username!'')}" type="text" autofocus autocomplete="username"
|
|
aria-invalid="<#if messagesPerField.existsError('username','password')>true</#if>"
|
|
/>
|
|
<#if messagesPerField.existsError('username','password')>
|
|
<span id="input-error" class="input-error" aria-live="polite">
|
|
${kcSanitize(messagesPerField.getFirstError('username','password'))?no_esc}
|
|
</span>
|
|
</#if>
|
|
</div>
|
|
</#if>
|
|
</#if>
|
|
|
|
<#if auth.attemptedUsername?has_content || !usernameHidden??>
|
|
<#-- Show password field if we're on password step OR if username is visible (combined form) -->
|
|
</#if>
|
|
|
|
<#if auth.attemptedUsername?has_content>
|
|
<#-- Password step -->
|
|
<div class="form-group">
|
|
<label for="password" class="pf-c-form__label pf-c-form__label-text">${msg("password")}</label>
|
|
<input tabindex="2" id="password" class="pf-c-form-control" name="password" type="password" autocomplete="current-password" autofocus
|
|
aria-invalid="<#if messagesPerField.existsError('username','password')>true</#if>"
|
|
/>
|
|
<#if messagesPerField.existsError('password')>
|
|
<span id="input-error-password" class="input-error" aria-live="polite">
|
|
${kcSanitize(messagesPerField.getFirstError('password'))?no_esc}
|
|
</span>
|
|
</#if>
|
|
</div>
|
|
</#if>
|
|
|
|
<#if (realm.rememberMe && !usernameHidden??) || realm.resetPasswordAllowed>
|
|
<div class="form-group login-pf-settings">
|
|
<#if realm.rememberMe && !usernameHidden??>
|
|
<div id="kc-form-options">
|
|
<div class="checkbox">
|
|
<label>
|
|
<#if login.rememberMe??>
|
|
<input tabindex="3" id="rememberMe" name="rememberMe" type="checkbox" checked> ${msg("rememberMe")}
|
|
<#else>
|
|
<input tabindex="3" id="rememberMe" name="rememberMe" type="checkbox"> ${msg("rememberMe")}
|
|
</#if>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</#if>
|
|
<#if realm.resetPasswordAllowed>
|
|
<span class="forgot-password"><a tabindex="5" href="${url.loginResetCredentialsUrl}">${msg("doForgotPassword")}</a></span>
|
|
</#if>
|
|
</div>
|
|
</#if>
|
|
|
|
<div id="kc-form-buttons" class="form-group">
|
|
<input type="hidden" id="id-hidden-input" name="credentialId" <#if auth.selectedCredential?has_content>value="${auth.selectedCredential}"</#if>/>
|
|
<input tabindex="4" class="pf-c-button pf-m-primary pf-m-block" name="login" id="kc-login" type="submit" value="${msg("doLogIn")}"/>
|
|
</div>
|
|
</form>
|
|
</#if>
|
|
</div>
|
|
</div>
|
|
<#elseif section = "info">
|
|
<#if realm.password && realm.registrationAllowed && !registrationDisabled??>
|
|
<div id="kc-registration">
|
|
<span>${msg("noAccount")} <a tabindex="6" href="${url.registrationUrl}">${msg("doRegister")}</a></span>
|
|
</div>
|
|
</#if>
|
|
<#elseif section = "socialProviders">
|
|
<#if realm.password && social?? && social.providers?has_content>
|
|
<div id="kc-social-providers">
|
|
<hr/>
|
|
<h4>${msg("identity-provider-login-label")}</h4>
|
|
<ul>
|
|
<#list social.providers as p>
|
|
<li>
|
|
<a id="social-${p.alias}" href="${p.loginUrl}">
|
|
<#if p.iconClasses?has_content>
|
|
<i class="${p.iconClasses}" aria-hidden="true"></i>
|
|
</#if>
|
|
<span>${p.displayName!}</span>
|
|
</a>
|
|
</li>
|
|
</#list>
|
|
</ul>
|
|
</div>
|
|
</#if>
|
|
</#if>
|
|
</@layout.registrationLayout>
|