refactor(app): changed ways we get data so we can have better reasons why app no worky

This commit is contained in:
2026-05-13 20:49:43 -05:00
parent e7af3d1182
commit 30ff7b71d9
11 changed files with 284 additions and 9 deletions

View File

@@ -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;