Skip to content

Commit

Permalink
fix: make getPermissions of auth provider optional (#3440)
Browse files Browse the repository at this point in the history
  • Loading branch information
salihozdemir committed Jan 23, 2023
1 parent 8f29546 commit 96d93eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-plums-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pankod/refine-core": patch
---

Made the auth provider's `usePermissions` method optional.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("useAuthProviderWithCloudConfig Hook", () => {
const { generateCloudAuthProvider } = result.current;
const { getPermissions } = generateCloudAuthProvider();

const response = await getPermissions();
const response = await getPermissions?.();
expect(response).toContain("admin");
});

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/contexts/auth/IAuthContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface AuthProvider {
logout: (params: any) => Promise<TLogoutData>;
checkAuth: (params?: any) => Promise<any>;
checkError: (error: any) => Promise<void>;
getPermissions: (params?: any) => Promise<any>;
getPermissions?: (params?: any) => Promise<any>;
getUserIdentity?: (params?: any) => Promise<any>;
}

Expand Down

0 comments on commit 96d93eb

Please sign in to comment.