From 92e1e82e095075edf04019887f9c2048c21d00d6 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Fri, 6 Sep 2024 09:02:30 +0200 Subject: [PATCH] fix: oauth2 login can fail in some cases because the user can't be found --- backend/src/oauth/oauth.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/oauth/oauth.service.ts b/backend/src/oauth/oauth.service.ts index 5d73df95..691469a9 100644 --- a/backend/src/oauth/oauth.service.ts +++ b/backend/src/oauth/oauth.service.ts @@ -51,7 +51,7 @@ export class OAuthService { await this.updateIsAdmin(user); const updatedUser = await this.prisma.user.findFirst({ where: { - email: user.email, + id: oauthUser.userId, }, }); this.logger.log(`Successful login for user ${user.email} from IP ${ip}`);