refactor(app): changed ways we get data so we can have better reasons why app no worky
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { redirect } from "@tanstack/react-router";
|
||||
import { adminClient, genericOAuthClient } from "better-auth/client/plugins";
|
||||
import { createAuthClient } from "better-auth/react";
|
||||
import { ac, admin, manager, systemAdmin, user } from "./auth-permissions";
|
||||
@@ -16,6 +17,14 @@ export const authClient = createAuthClient({
|
||||
}),
|
||||
genericOAuthClient(),
|
||||
],
|
||||
fetchOptions: {
|
||||
onError() {
|
||||
redirect({
|
||||
to: "/app-down",
|
||||
replace: true,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { useSession, signUp, signIn, signOut } = authClient;
|
||||
|
||||
Reference in New Issue
Block a user