mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
feat: allow empty account mapper
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user