fix: auth sub override (#9635)

This commit is contained in:
Jason Rasmussen 2024-05-21 09:07:34 -04:00 committed by GitHub
parent bb79df655d
commit 91b835cfeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 13 deletions

View file

@ -201,7 +201,7 @@ export class AuthService {
// link existing user
if (!user) {
const emailUser = await this.userRepository.getByEmail(profile.email);
if (emailUser) {
if (emailUser && !emailUser.oauthId) {
user = await this.userRepository.update(emailUser.id, { oauthId: profile.sub });
}
}