Skip to content

Commit

Permalink
Fixing the way we generate the backenduser object during jwt creation (
Browse files Browse the repository at this point in the history
  • Loading branch information
fozziethebeat authored Feb 4, 2023
1 parent ad6c39b commit ef5b9d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ const authOptions: AuthOptions = {
select: { name: true, role: true, isNew: true, accounts: true, id: true },
});

// Note: This could be cleaner and merged with src/lib/users.ts
const user: BackendUserCore = {
id,
id: accounts.length > 0 ? accounts[0].providerAccountId : id,
display_name: name,
auth_method: accounts.length > 0 ? accounts[0].provider : "local",
};
Expand Down

0 comments on commit ef5b9d7

Please sign in to comment.