Skip to content

Commit

Permalink
Guess login provider to store alongside user model (#4195)
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd authored Mar 7, 2024
1 parent f73e89a commit ba506d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion front/lib/iam/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function mapAuth0ProviderToLegacy(session: Session): LegacyProviderInfo | null {
return { provider: "github", providerId };

default:
return null;
return { provider: rawProvider, providerId };
}
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ba506d0

Please sign in to comment.