feat: update users on SAML setup and destroy [CW-2958][CW-5612] (#12346)

This commit is contained in:
Shivam Mishra
2025-09-15 21:20:22 +05:30
committed by GitHub
parent 458ed1e26d
commit 7a453f50f4
6 changed files with 184 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ class SamlUserBuilder
user = User.from_email(auth_attribute('email'))
if user
confirm_user_if_required(user)
convert_existing_user_to_saml(user)
return user
end
@@ -24,6 +25,13 @@ class SamlUserBuilder
create_user
end
def confirm_user_if_required(user)
return if user.confirmed?
user.skip_confirmation!
user.save!
end
def convert_existing_user_to_saml(user)
return if user.provider == 'saml'