Files
zitadel/internal/api/ui/login/static/templates/mfa_verification_u2f.html
T
Livio SpringandGitHub dfe064f902 fix(login): fix back button on 2fa screen to allow username change (#11125)
# Which Problems Are Solved

As reported to support, the back button on the various 2FA pages in
login V1 opened the default redirect URI, which likely started a new
auth request (e.g. from Console).

# How the Problems Are Solved

Change the back buttons to navigate to the login screen again, where a
user can change the username.
Additionally, the back button has been added to the U2F verification
screen.

# Additional Changes

None

# Additional Context

- from support
- backport to v4
2025-12-09 12:37:26 +00:00

53 lines
1.8 KiB
HTML

{{template "main-top" .}}
<div class="head">
<h1>{{t "VerifyMFAU2F.Title"}}</h1>
{{ template "user-profile" . }}
<p>{{t "VerifyMFAU2F.Description"}}</p>
</div>
<form action="{{ mfaInitU2FLoginUrl }}" method="POST">
{{ .CSRF }}
<input type="hidden" name="authRequestID" value="{{ .AuthReqID }}"/>
<input type="hidden" name="credentialAssertionData" value="{{ .CredentialCreationData }}"/>
<input type="hidden" name="credentialData"/>
<p class="wa-no-support lgn-error hidden">{{t "VerifyMFAU2F.NotSupported"}}</p>
<div id="wa-error" class="error hidden">
<span class="cause"></span>
<span>{{t "VerifyMFAU2F.ErrorRetry"}}</span>
</div>
{{ template "error-message" .}}
<div class="lgn-actions" id="webauthn">
<!-- position element in header -->
<a class="lgn-icon-button lgn-left-action" href="{{ loginNameChangeUrl .AuthReqID }}">
<i class="lgn-icon-arrow-left-solid"></i>
</a>
<span class="fill-space"></span>
<a id="btn-login" class="lgn-raised-button lgn-primary wa-support">{{t "VerifyMFAU2F.ValidateTokenButtonText"}}</a>
</div>
{{ if .MFAProviders }}
<div class="lgn-mfa-other">
<p>{{t "MFAProvider.ChooseOther"}}</p>
{{ range $provider := .MFAProviders}}
{{ $providerName := (t (printf "MFAProvider.Provider%v" $provider)) }}
<button class="lgn-stroked-button" type="submit" name="provider" value="{{$provider}}">{{$providerName}}</button>
{{ end }}
</div>
{{ end }}
</form>
<script src="{{ resourceUrl "scripts/utils.js" }}"></script>
<script src="{{ resourceUrl "scripts/webauthn.js" }}"></script>
<script src="{{ resourceUrl "scripts/webauthn_login.js" }}"></script>
{{template "main-bottom" .}}