Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Merge branch 'main' into feat/remove-browserrouter

Anthony Rimet046eedd1d2bb
diff --cc src/providers/supabase/authProvider.ts
index 997365c6,af51098c..3413feb0
--- a/src/providers/supabase/authProvider.ts
+++ b/src/providers/supabase/authProvider.ts
@@@ -56,4 -67,35 +67,8 @@@ export const authProvider: AuthProvide
return baseAuthProvider.checkAuth(params);
},
- // We need to ovveride the getPermissions here to avoid the `ra-supabase` retries
+ async getPermissions(params) {
+ const isInitialized = await getIsInitialized();
+ return isInitialized ? baseAuthProvider.getPermissions(params) : null;
+ },
- handleCallback: async () => {
- const { access_token, refresh_token, type } = getUrlParams();
- // Users have reset their password or have just been invited and must set a new password
- if (type === 'recovery' || type === 'invite') {
- if (access_token && refresh_token) {
- return {
- redirectTo: `/set-password?access_token=${access_token}&refresh_token=${refresh_token}&type=${type}`,
- };
- }
-
- if (process.env.NODE_ENV === 'development') {
- console.error(
- 'Missing access_token or refresh_token for an invite or recovery'
- );
- }
- }
- },
-};
-
-const getUrlParams = () => {
- const urlSearchParams = new URLSearchParams(window.location.search);
- const access_token = urlSearchParams.get('access_token');
- const refresh_token = urlSearchParams.get('refresh_token');
- const type = urlSearchParams.get('type');
-
- return { access_token, refresh_token, type };
};