Do not create password reset token when user logs with saml
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -233,6 +233,15 @@ func (s *AuthService) ActivateAccount(
|
|||||||
return nil, nil, err
|
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 {
|
if identity.HashedPassword == nil {
|
||||||
token, err := statelesstoken.NewToken(
|
token, err := statelesstoken.NewToken(
|
||||||
s.tokenSecret,
|
s.tokenSecret,
|
||||||
|
|||||||
Reference in New Issue
Block a user