You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
6.1 KiB
Plaintext

<#import "template.ftl" as layout>
<#import "field.ftl" as field>
<#import "tabs.ftl" as tabs>
<#import "buttons.ftl" as buttons>
<@layout.registrationLayout displayMessage=!messagesPerField.existsError('username'); section>
<#if section = "header">
${msg("emailForgotTitle")}
<#elseif section = "form">
<script type="text/javascript">
// Add styles
loadCSS('${url.resourcesPath}/css/lib/choices.css');
loadCSS('${url.resourcesPath}/css/component/smsSenderForm.css');
</script>
<form id="kc-reset-password-form" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post">
<input type="hidden" id="validation-type" name="validationType" value="${form.validationType!'email'}"/>
<@tabs.tabsBar panelId="reset-password-panel" filled=true pill=true activedId=form.validationType!'email'>
<@tabs.tabButton tabId="email" panelId="reset-password-panel" label="resetPasswordByEmail" />
<@tabs.tabButton tabId="phone" panelId="reset-password-panel" label="resetPasswordByPhone" />
</@tabs.tabsBar>
<@tabs.tabPanel panelId="reset-password-panel">
<@tabs.tabContent tabId="email" active=true>
<#assign label>
<#if !realm.loginWithEmailAllowed>${msg("username")}<#elseif !realm.registrationEmailAsUsername>${msg("usernameOrEmail")}<#else>${msg("email")}</#if>
</#assign>
<@field.input name="username" label=label value=auth.attemptedUsername!form.username!'' autofocus=true />
<span class="${properties.kcLoginMainFooterHelperText!}">
<#if realm.duplicateEmailsAllowed>
${msg("emailInstructionUsername")}
<#else>
${msg("emailInstruction")}
</#if>
</span>
</@tabs.tabContent>
<@tabs.tabContent tabId="phone">
<@field.group name="phoneNumber" label=msg("phoneNumber") error=kcSanitize(messagesPerField.get('phoneNumber'))?no_esc required=false>
<div class="${properties.kcInputGroup!}">
<div class="${properties.kcInputGroupItemClass!}">
<div class="${properties.kcInputClass!} areaCodeInputContainer">
<select tabindex="1" class="areaCodeInput" name="areaCode" data-value="${(form.areaCode!'')}">
</select>
</div>
</div>
<div class="${properties.kcInputGroupItemClass!} ${properties.kcFill}">
<div class="${properties.kcInputClass!} <#if messagesPerField.get('phoneNumber')?has_content>${properties.kcError}</#if>">
<input tabindex="2" class="phoneNumberInput" name="phoneNumber" value="${(form.phoneNumber!'')}" type="tel" />
</div>
</div>
</div>
</@field.group>
<@field.group name="smsCode" label=msg("smsVerificationCode") error=kcSanitize(messagesPerField.get('smsCode'))?no_esc required=false>
<div class="${properties.kcInputGroup!}">
<span class="${properties.kcInputGroupItemClass!} ${properties.kcFill}">
<div class="${properties.kcInputClass!}">
<input tabindex="2" type="text" maxlength="6" class="smsCodeInput" name="smsCode" value="${(form.smsCode!'')}" nospin"/>
</div>
</span>
<span class="${properties.kcInputGroupItemClass!}">
<button class="${properties.kcButtonPrimaryClass!} btnSendSmsCode" type="button">
${msg("sendSmsBtn")}
</button>
</span>
</div>
</@field.group>
</@tabs.tabContent>
</@tabs.tabPanel>
<@buttons.actionGroup>
<@buttons.button id="kc-form-buttons" label="doSubmit" class=["kcButtonPrimaryClass", "kcButtonBlockClass"]/>
<@buttons.buttonLink href=url.loginUrl label="backToLogin" class=["kcButtonSecondaryClass", "kcButtonBlockClass"]/>
</@buttons.actionGroup>
</form>
<script type="application/json" data-configs>
{
"realm": "${realm.name!''}",
"realmUrl": "/realms/${realm.name!''}"
}
</script>
<script type="application/json" data-messages>
{
"geetestCaptchaLangCode": "${msg("geetestCaptchaLangCode")}",
"error": "${msg("sendSmsError")}",
"captchaLoadError": "${msg("captchaLoadError")}",
"captchaCodeApiError": "${msg("captchaCodeApiError")}",
"countryNameLangCode": "${msg("phoneAreaCountryNameLangCode")}",
"sending": "${msg("smsSending")}",
"sendVerificationCode": "${msg("sendSmsBtn")}",
"resendVerificationCode": "${msg("resendSmsBtn")}",
"second": "${msg("second")}",
"phoneNumberIsEmpty": "${msg("errorPhoneNumberIsEmpty")}",
"sendSmsCodeError": "${msg("errorSendSmsCodeInternalError")}",
"areaNotSupported": "${msg("errorPhoneAreaNotSupported")}",
"captchaNotCompleted": "${msg("errorCaptchaRequired")}",
"cannotGetConfig": "${msg("errorCannotGetConfig")}",
"userNotExists": "${msg("errorPhoneUserNotFound")}",
"sendVerificationError": "${msg("errorSendVerificationError")}"
}
</script>
<script type="module" src="${url.resourcesPath}/js/resetPasswordPhoneOrEmail.js"></script>
</#if>
</@layout.registrationLayout>