fix(login): check for error before automatic idp redirect (#7891)

* fix(login): check for error before automatic idp redirect

* hide next button on login page if username password is not enabled
This commit is contained in:
Livio Spring 2024-05-03 09:57:24 +02:00 committed by GitHub
parent 900894161f
commit d177b82d2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -95,7 +95,7 @@ func (l *Login) renderLogin(w http.ResponseWriter, r *http.Request, authReq *dom
if err != nil {
errID, errMessage = l.getErrorMessage(r, err)
}
if singleIDPAllowed(authReq) {
if err == nil && singleIDPAllowed(authReq) {
l.handleIDP(w, r, authReq, authReq.AllowedExternalIDPs[0].IDPConfigID)
return
}

View File

@ -36,7 +36,9 @@
<a class="lgn-icon-button lgn-left-action" id="back-button" href="#">
<i class="lgn-icon-arrow-left-solid"></i>
</a>
{{if hasUsernamePasswordLogin}}
<button class="lgn-raised-button lgn-primary lgn-initial-focus" id="submit-button" type="submit">{{t "Login.NextButtonText"}}</button>
{{end}}
<span class="fill-space"></span>
{{if hasRegistration}}
<button class="lgn-stroked-button" name="register" value="true" formnovalidate>{{t "Login.RegisterButtonText"}}</button>