feature: setup password

This commit is contained in:
Scott Wilson
2025-01-27 18:51:35 -08:00
parent c7ec9ff816
commit 72468d5428
17 changed files with 691 additions and 12 deletions
@@ -1,12 +1,13 @@
import { createFileRoute, redirect } from "@tanstack/react-router";
import { createNotification } from "@app/components/notifications";
import { ROUTE_PATHS } from "@app/const/routes";
import { userKeys } from "@app/hooks/api";
import { authKeys, fetchAuthToken } from "@app/hooks/api/auth/queries";
import { fetchUserDetails } from "@app/hooks/api/users/queries";
export const Route = createFileRoute("/_authenticate")({
beforeLoad: async ({ context }) => {
beforeLoad: async ({ context, location }) => {
if (!context.serverConfig.initialized) {
throw redirect({ to: "/admin/signup" });
}
@@ -26,7 +27,7 @@ export const Route = createFileRoute("/_authenticate")({
});
});
if (!data.organizationId) {
if (!data.organizationId && location.pathname !== ROUTE_PATHS.Auth.PasswordSetupPage.path) {
throw redirect({ to: "/login/select-organization" });
}