mirror of https://github.com/coder/coder.git
fix: Ignore deleted users when signing up with OAuth (#4036)
This prevented a deleted user from signing up again when they were already linked with a previous account.
This commit is contained in:
parent
1ee1db9664
commit
57c7fcf27f
|
@ -518,7 +518,11 @@ func findLinkedUser(ctx context.Context, db database.Store, linkedID string, ema
|
|||
if err != nil {
|
||||
return database.User{}, database.UserLink{}, xerrors.Errorf("get user by id: %w", err)
|
||||
}
|
||||
return user, link, nil
|
||||
if !user.Deleted {
|
||||
return user, link, nil
|
||||
}
|
||||
// If the user was deleted, act as if no account link exists.
|
||||
user = database.User{}
|
||||
}
|
||||
|
||||
for _, email := range emails {
|
||||
|
|
Loading…
Reference in New Issue