feat: allow empty account mapper

This commit is contained in:
Balázs Orbán
2023-05-19 16:38:28 +02:00
parent da211e6cbe
commit 142abe3eea
2 changed files with 2 additions and 2 deletions

View File

@@ -158,7 +158,7 @@ export async function handleLogin(
const { provider: p } = options as InternalOptions<"oauth" | "oidc">
const { type, provider, providerAccountId, userId, ...tokenSet } = account
const defaults = { providerAccountId, provider, type, userId }
account = Object.assign(p.account(tokenSet), defaults)
account = Object.assign(p.account(tokenSet) ?? {}, defaults)
if (user) {
// If the user is already signed in and the OAuth account isn't already associated

View File

@@ -95,7 +95,7 @@ export type ProfileCallback<Profile> = (
tokens: TokenSet
) => Awaitable<User>
export type AccountCallback = (tokens: TokenSet) => TokenSet
export type AccountCallback = (tokens: TokenSet) => TokenSet | undefined | void
export interface OAuthProviderButtonStyles {
logo: string