mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user