Skip to content

Commit 984d754

Browse files
committed
fix types
1 parent 436daca commit 984d754

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cobuildlab/react-native-auth0",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "Todo",
55
"main": "lib/index.js",
66
"types": "./lib/index.d.ts",

src/provider.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ export const AuthProvider: React.FC<{
2525
});
2626
}, [client]);
2727

28-
const authorize: AuthClientContextType['authorize'] = async ({
29-
scope: newScope,
30-
options,
31-
}) => {
28+
const authorize: AuthClientContextType['authorize'] = async (params) => {
29+
const { scope: newScope, options } = params || {};
30+
3231
setState((prev) => ({ ...prev, isLoading: true }));
3332
client
3433
.authorize(newScope || scope, options)

src/types.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ export type CredentialsHandlersInput = CredentialsHandlersInputBase &
3333
);
3434

3535
export interface AuthClientContextType {
36-
authorize: (args: {
37-
scope?: string;
38-
options?: AuthorizeOptions;
39-
}) => Promise<void>;
36+
authorize: (
37+
args:
38+
| {
39+
scope?: string;
40+
options?: AuthorizeOptions;
41+
}
42+
| undefined,
43+
) => Promise<void>;
4044
isAuthenticated: boolean;
4145
isLoading: boolean;
4246
clearSession: () => Promise<void>;

0 commit comments

Comments
 (0)