fix: prevent password init on email verification for external users (#8602)

# Which Problems Are Solved

If a user is created through the login UI with an IdP and an unverified
email, the user is prompted with the email verification and to set a
password.
This was unintentionally changed with #8291

# How the Problems Are Solved

- Check if the user has any IdP linked when computing the
EmailVerification step.

# Additional Changes

None

# Additional Context

- reported in a support request
This commit is contained in:
Livio Spring
2024-09-13 17:51:06 +02:00
committed by GitHub
parent 14383cfe8c
commit 8831b33013
2 changed files with 69 additions and 1 deletions

View File

@@ -1092,7 +1092,7 @@ func (repo *AuthRequestRepo) nextSteps(ctx context.Context, request *domain.Auth
}
if !user.IsEmailVerified {
steps = append(steps, &domain.VerifyEMailStep{
InitPassword: !user.PasswordSet,
InitPassword: !user.PasswordSet && len(idps.Links) == 0,
})
}
if user.UsernameChangeRequired {