File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,13 @@ export function AuthKitProvider(props: AuthKitProviderProps) {
6262 refreshBufferInterval,
6363 } ) . then ( async ( client ) => {
6464 const user = client . getUser ( ) ;
65- setClient ( client ) ;
65+ setClient ( {
66+ getAccessToken : client . getAccessToken . bind ( client ) ,
67+ getUser : client . getUser . bind ( client ) ,
68+ signIn : client . signIn . bind ( client ) ,
69+ signUp : client . signUp . bind ( client ) ,
70+ signOut : client . signOut . bind ( client ) ,
71+ } ) ;
6672 setState ( ( prev ) => ( { ...prev , isLoading : false , user } ) ) ;
6773 } ) ;
6874 } ) ;
Original file line number Diff line number Diff line change 11import { createClient } from "@workos-inc/authkit-js" ;
22
3- export type Client = Awaited < ReturnType < typeof createClient > > ;
3+ export type Client = Pick <
4+ Awaited < ReturnType < typeof createClient > > ,
5+ "signIn" | "signUp" | "getUser" | "getAccessToken" | "signOut"
6+ > ;
7+
48export type CreateClientOptions = NonNullable <
59 Parameters < typeof createClient > [ 1 ]
610> ;
You can’t perform that action at this time.
0 commit comments