mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Select organization checkpoint
This commit is contained in:
@@ -7,7 +7,8 @@ import { SelectOrganizationPage } from "./SelectOrgPage";
|
||||
export const SelectOrganizationPageQueryParams = z.object({
|
||||
org_id: z.string().optional().catch(""),
|
||||
callback_port: z.coerce.number().optional().catch(undefined),
|
||||
is_admin_login: z.boolean().optional().catch(false)
|
||||
is_admin_login: z.boolean().optional().catch(false),
|
||||
force: z.boolean().optional()
|
||||
});
|
||||
|
||||
export const Route = createFileRoute("/_restrict-login-signup/login/select-organization")({
|
||||
|
||||
@@ -243,7 +243,7 @@ export const SignupInvitePage = () => {
|
||||
SecurityClient.setSignupToken(response.token);
|
||||
setStep(2);
|
||||
} else {
|
||||
navigate({ to: "/login" });
|
||||
navigate({ to: "/login/select-organization", search: { force: true } });
|
||||
|
||||
// TODO: Redirect user to the newly joined org. The commented code does not work due to auth issues.
|
||||
// const redirectExistingUser = async () => {
|
||||
|
||||
@@ -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