Skip to content

Commit

Permalink
fix(ts): infer provider type in signIn (#4679)
Browse files Browse the repository at this point in the history
* fix: signIn infer provider type

The "P" type it's not passed in any props, so the result type doesn't understand and return the false type always, Adding the "P" at provider type props.

* fix: P possibly undefined

Co-authored-by: arthurpedroti@gmail.com <arthurpedroti@LAPTOP-MVAK9RM5.localdomain>
  • Loading branch information
ArthurPedroti and arthurpedroti@gmail.com committed Jun 23, 2022
1 parent 66fb914 commit e03e234
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next-auth/src/react/index.tsx
Expand Up @@ -175,7 +175,7 @@ export async function getProviders() {
export async function signIn<
P extends RedirectableProviderType | undefined = undefined
>(
provider?: LiteralUnion<BuiltInProviderType>,
provider?: LiteralUnion<P extends RedirectableProviderType ? P | BuiltInProviderType : BuiltInProviderType>,
options?: SignInOptions,
authorizationParams?: SignInAuthorizationParams
): Promise<
Expand Down

0 comments on commit e03e234

Please sign in to comment.