Skip to content

Commit e03e234

Browse files
ArthurPedrotiarthurpedroti@gmail.com
and
arthurpedroti@gmail.com
authoredJun 23, 2022
fix(ts): infer provider type in signIn (#4679)
* 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>
1 parent 66fb914 commit e03e234

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎packages/next-auth/src/react/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export async function getProviders() {
175175
export async function signIn<
176176
P extends RedirectableProviderType | undefined = undefined
177177
>(
178-
provider?: LiteralUnion<BuiltInProviderType>,
178+
provider?: LiteralUnion<P extends RedirectableProviderType ? P | BuiltInProviderType : BuiltInProviderType>,
179179
options?: SignInOptions,
180180
authorizationParams?: SignInAuthorizationParams
181181
): Promise<

0 commit comments

Comments
 (0)
Please sign in to comment.