Skip to content

Commit

Permalink
Correct the type signature of account in callbacks.
Browse files Browse the repository at this point in the history
The `account` argument can be `undefined` if it's not immediately after a sign-in.
  • Loading branch information
w9 authored Oct 9, 2024
1 parent ad15137 commit a91f088
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export interface AuthConfig {
*/
signIn?: (params: {
user: User | AdapterUser
account: Account | null
account: Account | null | undefined
/**
* If OAuth provider is used, it contains the full
* OAuth profile returned by your provider.
Expand Down Expand Up @@ -452,7 +452,7 @@ export interface AuthConfig {
* Also includes {@link TokenSet}
* @note available when `trigger` is `"signIn"` or `"signUp"`
*/
account: Account | null
account: Account | null | undefined
/**
* The OAuth profile returned from your provider.
* (In case of OIDC it will be the decoded ID Token or /userinfo response)
Expand Down Expand Up @@ -497,7 +497,7 @@ export interface AuthConfig {
*/
signIn?: (message: {
user: User
account: Account | null
account: Account | null | undefined
profile?: Profile
isNewUser?: boolean
}) => Awaitable<void>
Expand Down

0 comments on commit a91f088

Please sign in to comment.