Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusrodrz committed Apr 11, 2022
1 parent 436daca commit 984d754
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cobuildlab/react-native-auth0",
"version": "0.3.1",
"version": "0.3.2",
"description": "Todo",
"main": "lib/index.js",
"types": "./lib/index.d.ts",
Expand Down
7 changes: 3 additions & 4 deletions src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ export const AuthProvider: React.FC<{
});
}, [client]);

const authorize: AuthClientContextType['authorize'] = async ({
scope: newScope,
options,
}) => {
const authorize: AuthClientContextType['authorize'] = async (params) => {
const { scope: newScope, options } = params || {};

setState((prev) => ({ ...prev, isLoading: true }));
client
.authorize(newScope || scope, options)
Expand Down
12 changes: 8 additions & 4 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ export type CredentialsHandlersInput = CredentialsHandlersInputBase &
);

export interface AuthClientContextType {
authorize: (args: {
scope?: string;
options?: AuthorizeOptions;
}) => Promise<void>;
authorize: (
args:
| {
scope?: string;
options?: AuthorizeOptions;
}
| undefined,
) => Promise<void>;
isAuthenticated: boolean;
isLoading: boolean;
clearSession: () => Promise<void>;
Expand Down

0 comments on commit 984d754

Please sign in to comment.