Fixing the way we generate the backenduser object during jwt creation (#1090)

This commit is contained in:
Keith Stevens
2023-02-04 16:18:19 +09:00
committed by GitHub
parent ad6c39b81a
commit ef5b9d7757
+2 -1
View File
@@ -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",
};