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
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 });
}
}