Do not create password reset token when user logs with saml

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-18 18:28:31 +04:00
parent cfb81ca154
commit 2e4a011009

View File

@@ -233,6 +233,15 @@ func (s *AuthService) ActivateAccount(
return nil, nil, err
}
count, err := s.AccountService.CountSAMLConfigurationsForEmail(ctx, identity.EmailAddress)
if err != nil {
return nil, nil, fmt.Errorf("cannot count SAML configurations: %w", err)
}
if count > 0 {
return profile, nil, nil
}
if identity.HashedPassword == nil {
token, err := statelesstoken.NewToken(
s.tokenSecret,