Skip to content

Commit ef5b9d7

Browse files
Fixing the way we generate the backenduser object during jwt creation (#1090)
1 parent ad6c39b commit ef5b9d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

website/src/pages/api/auth/[...nextauth].ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ const authOptions: AuthOptions = {
112112
select: { name: true, role: true, isNew: true, accounts: true, id: true },
113113
});
114114

115+
// Note: This could be cleaner and merged with src/lib/users.ts
115116
const user: BackendUserCore = {
116-
id,
117+
id: accounts.length > 0 ? accounts[0].providerAccountId : id,
117118
display_name: name,
118119
auth_method: accounts.length > 0 ? accounts[0].provider : "local",
119120
};

0 commit comments

Comments
 (0)