Skip to content

Commit 57c7fcf

Browse files
authored
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.
1 parent 1ee1db9 commit 57c7fcf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

coderd/userauth.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,11 @@ func findLinkedUser(ctx context.Context, db database.Store, linkedID string, ema
518518
if err != nil {
519519
return database.User{}, database.UserLink{}, xerrors.Errorf("get user by id: %w", err)
520520
}
521-
return user, link, nil
521+
if !user.Deleted {
522+
return user, link, nil
523+
}
524+
// If the user was deleted, act as if no account link exists.
525+
user = database.User{}
522526
}
523527

524528
for _, email := range emails {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy