Select organization checkpoint

This commit is contained in:
x032205
2025-06-04 16:54:14 -04:00
parent 92b9abb52b
commit 952e60f08a
3 changed files with 8 additions and 4 deletions
@@ -15,7 +15,8 @@ import { setAuthToken } from "@app/hooks/api/reactQuery";
import { ProjectType } from "@app/hooks/api/workspace/types";
const QueryParamsSchema = z.object({
callback_port: z.coerce.number().optional().catch(undefined)
callback_port: z.coerce.number().optional().catch(undefined),
force: z.boolean().optional()
});
export const AuthConsentWrapper = () => {
@@ -71,7 +72,7 @@ export const AuthConsentWrapper = () => {
export const Route = createFileRoute("/_restrict-login-signup")({
validateSearch: zodValidator(QueryParamsSchema),
search: {
middlewares: [stripSearchParams({ callback_port: undefined })]
middlewares: [stripSearchParams({ callback_port: undefined, force: undefined })]
},
beforeLoad: async ({ context, location, search }) => {
if (location.pathname === "/signupinvite") return;
@@ -93,6 +94,8 @@ export const Route = createFileRoute("/_restrict-login-signup")({
setAuthToken(data.token);
if (location.pathname.endsWith("select-organization") && search?.force === true) return;
// to do cli login
if (search?.callback_port) {
if (location.pathname.endsWith("select-organization") || location.pathname.endsWith("login"))