From ba506d0c60bf43c22f1f089a28998ab2ac5870e1 Mon Sep 17 00:00:00 2001 From: Flavien David Date: Thu, 7 Mar 2024 14:00:28 +0100 Subject: [PATCH] Guess login provider to store alongside user model (#4195) --- front/lib/iam/users.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/front/lib/iam/users.ts b/front/lib/iam/users.ts index 48f89ec4a9f4..11330ef4c048 100644 --- a/front/lib/iam/users.ts +++ b/front/lib/iam/users.ts @@ -52,7 +52,7 @@ function mapAuth0ProviderToLegacy(session: Session): LegacyProviderInfo | null { return { provider: "github", providerId }; default: - return null; + return { provider: rawProvider, providerId }; } } @@ -130,6 +130,7 @@ export async function createOrUpdateUser( const u = await User.create({ auth0Sub: externalUser.sub, + provider: mapAuth0ProviderToLegacy(session)?.provider, username: externalUser.nickname, email: externalUser.email, name: externalUser.name,