mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 11:29:42 +00:00
Select organization checkpoint
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user