OIDC: Drop residual cluster-OIDC gate on provisioned account email

This commit is contained in:
Michael Mayer 2026-06-10 02:13:27 +00:00
parent a8849d111d
commit 14edf40abd

View file

@ -386,10 +386,11 @@ func OIDCRedirect(router *gin.RouterGroup) {
user.Details().BirthYear = birthDate.Year()
}
// Set email when verified, not from cluster OIDC, and not held by a
// different account. The email is informational (not an auth identifier),
// so cluster OIDC omits it and a clash never blocks provisioning.
if bool(userInfo.EmailVerified) && !conf.ClusterOIDC() && entity.UserEmailAvailable(userInfo.Email, user.UserUID) {
// Set email only when the IdP marks it verified and no other account
// holds it. The email is informational (not an auth identifier), so a
// clash never blocks provisioning; the Portal OP forwards real
// verification state, so unverified cluster emails are simply not stored.
if bool(userInfo.EmailVerified) && entity.UserEmailAvailable(userInfo.Email, user.UserUID) {
user.UserEmail = clean.Email(userInfo.Email)
user.VerifiedAt = entity.TimeStamp()
}