portal: require Keycloak VERIFY_EMAIL
This commit is contained in:
parent
24fc02ff1f
commit
6375e87d2a
@ -181,15 +181,14 @@ def provision_access_request(request_code: str) -> ProvisionResult:
|
||||
email = contact_email.strip()
|
||||
if not email:
|
||||
raise RuntimeError("missing verified email address")
|
||||
email_is_verified = bool(email_verified_at)
|
||||
required_actions = ["UPDATE_PASSWORD", "CONFIGURE_TOTP"]
|
||||
if not email_is_verified:
|
||||
required_actions.append("VERIFY_EMAIL")
|
||||
# Always enforce email verification in Keycloak itself (even if the portal
|
||||
# already verified an external email before approval).
|
||||
required_actions = ["UPDATE_PASSWORD", "VERIFY_EMAIL", "CONFIGURE_TOTP"]
|
||||
payload = {
|
||||
"username": username,
|
||||
"enabled": True,
|
||||
"email": email,
|
||||
"emailVerified": email_is_verified,
|
||||
"emailVerified": False,
|
||||
"requiredActions": required_actions,
|
||||
"attributes": {MAILU_EMAIL_ATTR: [mailu_email]},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user