Authentication finaly redirect to auth page
This commit is contained in:
@@ -67,11 +67,7 @@ export const authProvider: AuthProvider = {
|
|||||||
onError: async (error) => {
|
onError: async (error) => {
|
||||||
if (error?.status === 401) {
|
if (error?.status === 401) {
|
||||||
localStorage.removeItem("access_token");
|
localStorage.removeItem("access_token");
|
||||||
return Promise<{
|
return {redirectTo: "/login"}
|
||||||
redirectTo: "/login",
|
|
||||||
logout: true,
|
|
||||||
error: { message: "Unauthorized" },
|
|
||||||
}>;
|
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user