Skip to content

Commit

Permalink
🤖 Merge PR #51477 [types@next-auth] - Update client.d.ts by @StefanSe…
Browse files Browse the repository at this point in the history
…lfTaught

* Update client.d.ts

Added redirect type to signIn and signOut

* added tests & remove white space
  • Loading branch information
StefanSelfTaught committed Mar 2, 2021
1 parent 19efb52 commit 78d3193
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion types/next-auth/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ declare function signin(
provider?: string,
data?: GenericObject & {
callbackUrl?: string;
redirect?: boolean;
},
): Promise<void>;
declare const signIn: typeof signin;
declare function signout(data?: { callbackUrl?: string }): Promise<void>;
declare function signout(
data?: {
callbackUrl?: string;
redirect?: boolean;
}
): Promise<void>;
declare const signOut: typeof signout;
declare function options(options: SetOptionsParams): void;
declare const setOptions: typeof options;
Expand Down
4 changes: 2 additions & 2 deletions types/next-auth/next-auth-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ client.getCsrfToken({ req });
client.csrfToken({ req });

// $ExpectType Promise<void>
client.signin('github', { data: 'foo' });
client.signin('github', { data: 'foo', redirect: false });

// $ExpectType Promise<void>
client.signout();

// $ExpectType Promise<void>
client.signout({ callbackUrl: 'https://foo.com/callback' });
client.signout({ callbackUrl: 'https://foo.com/callback', redirect: true });

// $ExpectType ReactElement<any, any> | null
client.Provider({
Expand Down

0 comments on commit 78d3193

Please sign in to comment.