Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat(admin): add guided self-hosted bootstrap onboarding (#7448)

Andrew Huang95a48446dfe1
diff --git a/DESIGN.md b/DESIGN.md
index d5cc723dc2..902995ad28 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -123,16 +123,17 @@ font or substitute one role for another:
brand-forward microcopy. It does not replace `font-mono` and should not be
used for code editors, data tables, IDs, logs, or secret values.
-| Role | Class | Notes |
-| ---------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------ |
-| Page title (h1) | `text-2xl font-medium underline underline-offset-4 decoration-<scope>/90` | In `PageHeader`; scope icon (size 26) sits inline before the title |
-| Page description | `text-mineshaft-300` | Sits under the title, `mt-1.5` |
-| Card title | `text-lg font-semibold leading-none` | `flex gap-1.5` so badges can sit inline |
-| Card description | `text-sm text-accent` | |
-| Body | `text-sm` | Default for table cells, form values, dialog content |
-| Label / meta | `text-xs text-accent` | Field labels, table column captions, metadata |
-| Badge | `text-xs` (auto, via `Badge`) | Never override |
-| Button | `text-sm` (md/sm/lg), `text-xs` (xs) | Auto via `Button` sizing |
+| Role | Class | Notes |
+| ----------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------ |
+| Page title (h1) | `text-2xl font-medium underline underline-offset-4 decoration-<scope>/90` | In `PageHeader`; scope icon (size 26) sits inline before the title |
+| Page description | `text-mineshaft-300` | Sits under the title, `mt-1.5` |
+| Card title | `text-lg font-semibold leading-none` | `flex gap-1.5` so badges can sit inline |
+| Card description | `text-sm text-accent` | |
+| Body | `text-sm` | Default for table cells, form values, dialog content |
+| Label / meta | `text-xs text-accent` | Field labels, table column captions, metadata |
+| Field helper / feedback | `text-2xs leading-snug` | Defaults via `FieldDescription` and `FieldFeedback` |
+| Badge | `text-xs` (auto, via `Badge`) | Never override |
+| Button | `text-sm` (md/sm/lg), `text-xs` (xs) | Auto via `Button` sizing |
On brand-forward surfaces, a short phrase may use the `text-highlight`
utility to create the solid project-yellow text block. Keep the phrase short,
diff --git a/backend/e2e-test/routes/v1/admin.spec.ts b/backend/e2e-test/routes/v1/admin.spec.ts
new file mode 100644
index 0000000000..547cccfd58
--- /dev/null
+++ b/backend/e2e-test/routes/v1/admin.spec.ts
@@ -0,0 +1,136 @@
+import { randomUUID } from "node:crypto";
+
+import { TableName } from "@app/db/schemas";
+import { KeyStorePrefixes } from "@app/keystore/keystore";
+import { ADMIN_CONFIG_DB_UUID } from "@app/services/super-admin/super-admin-service";
+import { LoginMethod, SuperAdminErrorCode } from "@app/services/super-admin/super-admin-types";
+
+const updateServerConfig = (body: Record<string, unknown>) =>
+ testServer.inject({
+ method: "PATCH",
+ url: "/api/v1/admin/config",
+ headers: {
+ authorization: `Bearer ${jwtAuthToken}`
+ },
+ body
+ });
+
+describe("Admin V1 Router", () => {
+ describe("admin signup", () => {
+ let signupEmail: string;
+ let organizationName: string;
+ let createdUserId: string | undefined;
+ let createdOrganizationId: string | undefined;
+
+ beforeEach(async () => {
+ signupEmail = `admin-signup-${randomUUID()}@localhost.local`;
+ organizationName = `Admin Org ${randomUUID()}`;
+ createdUserId = undefined;
+ createdOrganizationId = undefined;
+
+ await testSuperAdminDAL.updateById(ADMIN_CONFIG_DB_UUID, { initialized: false });
+ await testRedis.del(KeyStorePrefixes.AdminConfig);
+ });
+
+ afterEach(async () => {
+ const organization =
+ createdOrganizationId ??
+ (await testDb(TableName.Organization).where({ name: organizationName }).first<{ id: string }>("id"))?.id;
+ const user =
+ createdUserId ?? (await testDb(TableName.Users).where({ email: signupEmail }).first<{ id: string }>("id"))?.id;
+
+ if (organization) {
+ await testDb(TableName.Organization).where({ id: organization }).delete();
+ }
+ if (user) {
+ await testDb(TableName.Users).where({ id: user }).delete();
+ }
+
+ await testSuperAdminDAL.updateById(ADMIN_CONFIG_DB_UUID, {
+ initialized: true,
+ allowSignUp: true
+ });
+ await testRedis.del(KeyStorePrefixes.AdminConfig);
+ });
+
+ test("creates the initial organization with the supplied name", async () => {
+ const response = await testServer.inject({
+ method: "POST",
+ url: "/api/v1/admin/signup",
+ body: {
+ email: signupEmail,
+ password: "TestInfisical@123",
+ firstName: "Admin",
+ lastName: "User",
+ organizationName
+ }
+ });
+
+ expect(response.statusCode).toBe(200);
+
+ const payload = response.json();
+ createdUserId = payload.user.id;
+ createdOrganizationId = payload.organization.id;
+
+ expect(payload.organization.name).toBe(organizationName);
+ });
+
+ test("uses the default organization name when the field is omitted", async () => {
+ organizationName = "Admin Org";
+
+ const response = await testServer.inject({
+ method: "POST",
+ url: "/api/v1/admin/signup",
+ body: {
+ email: signupEmail,
+ password: "TestInfisical@123",
+ firstName: "Admin",
+ lastName: "User"
+ }
+ });
+
+ expect(response.statusCode).toBe(200);
+
+ const payload = response.json();
+ createdUserId = payload.user.id;
+ createdOrganizationId = payload.organization.id;
+
+ expect(payload.organization.name).toBe(organizationName);
+ });
+ });
+
+ describe("allowed signup domains", () => {
+ afterEach(async () => {
+ await testSuperAdminDAL.updateById(ADMIN_CONFIG_DB_UUID, { allowedSignUpDomain: null });
+ await testRedis.del(KeyStorePrefixes.AdminConfig);
+ });
+
+ test("normalizes valid domains before persisting them", async () => {
+ const response = await updateServerConfig({
+ allowedSignUpDomain: " @Example.com, example.com, Team.Example.com "
+ });
+
+ expect(response.statusCode).toBe(200);
+ expect(response.json().config.allowedSignUpDomain).toBe("example.com, team.example.com");
+ });
+
+ test.each(["example", "https://example.com", ","])("rejects an invalid domain list: %s", async (domains) => {
+ const response = await updateServerConfig({
+ allowedSignUpDomain: domains
+ });
+
+ expect(response.statusCode).toBe(422);
+ });
+ });
+
+ describe("server config lockout protection", () => {
+ test("returns a stable error code when login methods would lock out the super admin", async () => {
+ const response = await updateServerConfig({ enabledLoginMethods: [LoginMethod.GOOGLE] });
+
+ expect(response.statusCode).toBe(400);
+ expect(response.json()).toMatchObject({
+ error: SuperAdminErrorCode.AuthMethodLockout
+ });
+ });
+ });
+});
diff --git a/backend/src/db/migrations/20260727120000_add_onboarding_completed_to_super_admin.ts b/backend/src/db/migrations/20260727120000_add_onboarding_completed_to_super_admin.ts
new file mode 100644
index 0000000000..4620118815
--- /dev/null
+++ b/backend/src/db/migrations/20260727120000_add_onboarding_completed_to_super_admin.ts
@@ -0,0 +1,25 @@
+import { Knex } from "knex";
+
+import { TableName } from "../schemas";
+
+export async function up(knex: Knex): Promise<void> {
+ const hasOnboardingCompletedColumn = await knex.schema.hasColumn(TableName.SuperAdmin, "onboardingCompleted");
+
+ if (!hasOnboardingCompletedColumn) {
+ await knex.schema.alterTable(TableName.SuperAdmin, (table) => {
+ table.boolean("onboardingCompleted").notNullable().defaultTo(false);
+ });
+
+ await knex(TableName.SuperAdmin).where({ initialized: true }).update({ onboardingCompleted: true });
+ }
+}
+
+export async function down(knex: Knex): Promise<void> {
+ const hasOnboardingCompletedColumn = await knex.schema.hasColumn(TableName.SuperAdmin, "onboardingCompleted");
+
+ if (hasOnboardingCompletedColumn) {
+ await knex.schema.alterTable(TableName.SuperAdmin, (table) => {
+ table.dropColumn("onboardingCompleted");
+ });
+ }
+}
diff --git a/backend/src/db/schemas/super-admin.ts b/backend/src/db/schemas/super-admin.ts
index 9df8cc0db9..593b2beeca 100644
--- a/backend/src/db/schemas/super-admin.ts
+++ b/backend/src/db/schemas/super-admin.ts
@@ -36,7 +36,8 @@ export const SuperAdminSchema = z.object({
encryptedGitHubAppConnectionId: zodBuffer.nullable().optional(),
encryptedGitHubAppConnectionPrivateKey: zodBuffer.nullable().optional(),
encryptedEnvOverrides: zodBuffer.nullable().optional(),
- fipsEnabled: z.boolean().default(false)
+ fipsEnabled: z.boolean().default(false),
+ onboardingCompleted: z.boolean().default(false)
});
export type TSuperAdmin = z.infer<typeof SuperAdminSchema>;
diff --git a/backend/src/lib/validator/email-domain-matcher.test.ts b/backend/src/lib/validator/email-domain-matcher.test.ts
new file mode 100644
index 0000000000..17b61efe76
--- /dev/null
+++ b/backend/src/lib/validator/email-domain-matcher.test.ts
@@ -0,0 +1,33 @@
+import {
+ AllowedEmailDomainsSchema,
+ matchesAllowedEmailDomain,
+ normalizeAllowedEmailDomains
+} from "./email-domain-matcher";
+
+describe("allowed email domains", () => {
+ test("normalizes prefixes, casing, whitespace, and duplicates", () => {
+ expect(normalizeAllowedEmailDomains(" @Example.com, example.com, TEAM.example.com ")).toBe(
+ "example.com, team.example.com"
+ );
+ });
+
+ test.each(["example", "https://example.com", "example..com", "-example.com", "@", ","])(
+ "rejects an invalid domain: %s",
+ (domain) => {
+ expect(AllowedEmailDomainsSchema.safeParse(domain).success).toBe(false);
+ }
+ );
+
+ test("accepts a blank allowance and valid comma-separated domains", () => {
+ expect(AllowedEmailDomainsSchema.parse("")).toBe("");
+ expect(AllowedEmailDomainsSchema.parse("@Example.com, team.example.com")).toBe("example.com, team.example.com");
+ });
+
+ test("matches domains case-insensitively and supports legacy @ prefixes", () => {
+ expect(matchesAllowedEmailDomain("[email protected]", "@example.com")).toBe(true);
+ });
+
+ test("does not match a parent domain unless it is explicitly allowed", () => {
+ expect(matchesAllowedEmailDomain("[email protected]", "example.com")).toBe(false);
+ });
+});
diff --git a/backend/src/lib/validator/email-domain-matcher.ts b/backend/src/lib/validator/email-domain-matcher.ts
index 3b17848720..ac53ea2fab 100644
--- a/backend/src/lib/validator/email-domain-matcher.ts
+++ b/backend/src/lib/validator/email-domain-matcher.ts
@@ -1,3 +1,52 @@
+import { z } from "zod";
+
+import { isValidEmailDomain } from "./validate-email";
+
+const MAX_ALLOWED_EMAIL_DOMAINS_LENGTH = 255;
+
+const getDomainEntries = (allowedDomainsConfig: string) =>
+ allowedDomainsConfig
+ .split(",")
+ .map((domain) => domain.trim())
+ .filter(Boolean);
+
+const normalizeDomain = (domain: string) => domain.replace(/^@/, "").trim().toLowerCase();
+
+export const normalizeAllowedEmailDomains = (allowedDomainsConfig: string): string =>
+ Array.from(new Set(getDomainEntries(allowedDomainsConfig).map(normalizeDomain))).join(", ");
+
+export const AllowedEmailDomainsSchema = z
+ .string()
+ .superRefine((value, context) => {
+ const domainEntries = getDomainEntries(value);
+ const invalidDomains = domainEntries.filter((domain) => !isValidEmailDomain(normalizeDomain(domain)));
+
+ if (value.trim() && !domainEntries.length) {
+ context.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: "Enter at least one valid email domain"
+ });
+ }
+
+ if (invalidDomains.length) {
+ context.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: `Invalid email domain${invalidDomains.length > 1 ? "s" : ""}: ${invalidDomains.join(", ")}`
+ });
+ }
+
+ if (normalizeAllowedEmailDomains(value).length > MAX_ALLOWED_EMAIL_DOMAINS_LENGTH) {
+ context.addIssue({
+ code: z.ZodIssueCode.too_big,
+ maximum: MAX_ALLOWED_EMAIL_DOMAINS_LENGTH,
+ inclusive: true,
+ type: "string",
+ message: `Email domains must be ${MAX_ALLOWED_EMAIL_DOMAINS_LENGTH} characters or fewer`
+ });
+ }
+ })
+ .transform(normalizeAllowedEmailDomains);
+
/**
* Checks if an email's domain matches the allowed domains configuration.
* Supports exact domains (e.g. "example.com") and wildcard patterns (e.g. "*.example.com").
@@ -27,7 +76,7 @@ export const matchesAllowedEmailDomain = (email: string, allowedDomainsConfig: s
.filter(Boolean);
for (const pattern of patterns) {
- const patternLower = pattern.toLowerCase();
+ const patternLower = normalizeDomain(pattern);
if (patternLower.startsWith("*.")) {
// Wildcard: *.suffix - matches exact suffix or subdomains only (domain === suffix or domain ends with .suffix)
diff --git a/backend/src/lib/validator/index.ts b/backend/src/lib/validator/index.ts
index ce762d5fc4..b36eb0131a 100644
--- a/backend/src/lib/validator/index.ts
+++ b/backend/src/lib/validator/index.ts
@@ -1,4 +1,8 @@
-export { matchesAllowedEmailDomain } from "./email-domain-matcher";
+export {
+ AllowedEmailDomainsSchema,
+ matchesAllowedEmailDomain,
+ normalizeAllowedEmailDomains
+} from "./email-domain-matcher";
export type { TValidatedHost } from "./safe-request";
export { buildSsrfSafeAgent, safeRequest } from "./safe-request";
export { isDisposableEmail, isValidEmailDomain, sanitizeEmail, validateEmail } from "./validate-email";
diff --git a/backend/src/server/routes/v1/admin-router.ts b/backend/src/server/routes/v1/admin-router.ts
index c3deb3f3c1..e09baf0f41 100644
--- a/backend/src/server/routes/v1/admin-router.ts
+++ b/backend/src/server/routes/v1/admin-router.ts
@@ -13,6 +13,7 @@ import { LicenseType } from "@app/ee/services/license/license-types";
import { getConfig, overridableKeys } from "@app/lib/config/env";
import { crypto } from "@app/lib/crypto/cryptography";
import { BadRequestError } from "@app/lib/errors";
+import { AllowedEmailDomainsSchema } from "@app/lib/validator";
import { PASSWORD_POLICY, PasswordPolicyConfigSchema, PasswordPolicySchema } from "@app/lib/validator/password-policy";
import { invalidateCacheLimit, readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { addAuthOriginDomainCookie } from "@app/server/lib/cookie";
@@ -51,6 +52,7 @@ const SanitizedSuperAdminSchema = z.object({
trustSamlEmails: z.boolean().nullish(),
trustLdapEmails: z.boolean().nullish(),
trustOidcEmails: z.boolean().nullish(),
+ onboardingCompleted: z.boolean().optional(),
adminIdentityIds: z.string().array().nullable().optional(),
fipsEnabled: z.boolean().optional(),
isMigrationModeOn: z.boolean().optional(),
@@ -148,10 +150,11 @@ export const registerAdminRouter = async (server: FastifyZodProvider) => {
operationId: "updateAdminConfig",
body: z.object({
allowSignUp: z.boolean().optional(),
- allowedSignUpDomain: z.string().optional().nullable(),
+ allowedSignUpDomain: AllowedEmailDomainsSchema.optional().nullable(),
trustSamlEmails: z.boolean().optional(),
trustLdapEmails: z.boolean().optional(),
trustOidcEmails: z.boolean().optional(),
+ onboardingCompleted: z.boolean().optional(),
defaultAuthOrgId: z.string().optional().nullable(),
enabledLoginMethods: z
.nativeEnum(LoginMethod)
@@ -640,7 +643,8 @@ export const registerAdminRouter = async (server: FastifyZodProvider) => {
email: z.string().email().trim(),
password: PasswordPolicySchema,
firstName: z.string().trim().min(1),
- lastName: z.string().trim().optional()
+ lastName: z.string().trim().optional(),
+ organizationName: GenericResourceNameSchema.optional()
}),
response: {
200: z.object({
diff --git a/backend/src/server/routes/v3/signup-router.ts b/backend/src/server/routes/v3/signup-router.ts
index 3720f0c146..e62da8b8c5 100644
--- a/backend/src/server/routes/v3/signup-router.ts
+++ b/backend/src/server/routes/v3/signup-router.ts
@@ -3,6 +3,7 @@ import { z } from "zod";
import { getConfig } from "@app/lib/config/env";
import { ForbiddenRequestError } from "@app/lib/errors";
import { logger } from "@app/lib/logger";
+import { matchesAllowedEmailDomain } from "@app/lib/validator";
import { PasswordPolicySchema } from "@app/lib/validator/password-policy";
import { authRateLimit, smtpRateLimit } from "@app/server/config/rateLimiter";
import { addAuthOriginDomainCookie } from "@app/server/lib/cookie";
@@ -49,8 +50,7 @@ export const registerSignupRouter = async (server: FastifyZodProvider) => {
if (serverCfg?.allowedSignUpDomain) {
const domain = email.split("@")[1];
- const allowedDomains = serverCfg.allowedSignUpDomain.split(",").map((e) => e.trim());
- if (!allowedDomains.includes(domain)) {
+ if (!matchesAllowedEmailDomain(email, serverCfg.allowedSignUpDomain)) {
throw new ForbiddenRequestError({
message: `Email with a domain (@${domain}) is not supported`
});
diff --git a/backend/src/services/auth/auth-login-service.ts b/backend/src/services/auth/auth-login-service.ts
index e9b3d3f77f..faf320e898 100644
--- a/backend/src/services/auth/auth-login-service.ts
+++ b/backend/src/services/auth/auth-login-service.ts
@@ -32,7 +32,7 @@ import {
authAttemptCounter,
recordAuthAttemptMetric
} from "@app/lib/telemetry/metrics";
-import { sanitizeEmail, validateEmail } from "@app/lib/validator";
+import { matchesAllowedEmailDomain, sanitizeEmail, validateEmail } from "@app/lib/validator";
import { getUserAgentType } from "@app/server/plugins/audit-log";
import { getServerCfg } from "@app/services/super-admin/super-admin-service";
@@ -844,8 +844,7 @@ export const authLoginServiceFactory = ({
if (serverCfg?.allowedSignUpDomain) {
const domain = email.split("@")[1];
- const allowedDomains = serverCfg.allowedSignUpDomain.split(",").map((e) => e.trim());
- if (!allowedDomains.includes(domain))
+ if (!matchesAllowedEmailDomain(email, serverCfg.allowedSignUpDomain))
throw new BadRequestError({
message: `Email with a domain (@${domain}) is not supported`,
name: "Oauth 2 login"
diff --git a/backend/src/services/super-admin/super-admin-service.ts b/backend/src/services/super-admin/super-admin-service.ts
index 2dfc794862..89073c49cf 100644
--- a/backend/src/services/super-admin/super-admin-service.ts
+++ b/backend/src/services/super-admin/super-admin-service.ts
@@ -61,6 +61,7 @@ import {
CacheType,
EnvOverrides,
LoginMethod,
+ SuperAdminErrorCode,
TAdminBootstrapInstanceDTO,
TAdminCreateEmailDomainDTO,
TAdminDeleteEmailDomainDTO,
@@ -376,6 +377,7 @@ export const superAdminServiceFactory = ({
if (!canServerAdminAccessAfterApply) {
throw new BadRequestError({
+ name: SuperAdminErrorCode.AuthMethodLockout,
message: "You must configure at least one auth method to prevent account lockout"
});
}
@@ -512,7 +514,15 @@ export const superAdminServiceFactory = ({
return updatedServerCfg;
};
- const adminSignUp = async ({ lastName, firstName, email, password, ip, userAgent }: TAdminSignUpDTO) => {
+ const adminSignUp = async ({
+ lastName,
+ firstName,
+ email,
+ password,
+ organizationName,
+ ip,
+ userAgent
+ }: TAdminSignUpDTO) => {
const appCfg = getConfig();
const sanitizedEmail = email.trim().toLowerCase();
@@ -541,7 +551,7 @@ export const superAdminServiceFactory = ({
return { user: { ...newUser, hashedPassword: null } };
});
- const initialOrganizationName = appCfg.INITIAL_ORGANIZATION_NAME ?? "Admin Org";
+ const initialOrganizationName = organizationName ?? appCfg.INITIAL_ORGANIZATION_NAME ?? "Admin Org";
const organization = await orgService.createOrganization({
userId: userInfo.user.id,
diff --git a/backend/src/services/super-admin/super-admin-types.ts b/backend/src/services/super-admin/super-admin-types.ts
index 95edd96251..975b953ff0 100644
--- a/backend/src/services/super-admin/super-admin-types.ts
+++ b/backend/src/services/super-admin/super-admin-types.ts
@@ -5,6 +5,7 @@ export type TAdminSignUpDTO = {
password: string;
lastName?: string;
firstName: string;
+ organizationName?: string;
ip: string;
userAgent: string;
};
@@ -69,6 +70,10 @@ export enum LoginMethod {
OIDC = "oidc"
}
+export enum SuperAdminErrorCode {
+ AuthMethodLockout = "SUPER_ADMIN_AUTH_METHOD_LOCKOUT"
+}
+
export enum CacheType {
ALL = "all",
SECRETS = "secrets"
diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js
index 843a9602eb..3667e3ec2b 100644
--- a/frontend/eslint.config.js
+++ b/frontend/eslint.config.js
@@ -58,6 +58,7 @@ export default tseslint.config(
quotes: ["error", "double", { avoidEscape: true }],
"comma-dangle": ["error", "only-multiline"],
"react/react-in-jsx-scope": "off",
+ "react/prop-types": "off",
"import/prefer-default-export": "off",
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/ban-ts-comment": "warn",
diff --git a/frontend/src/components/auth/AuthPageHeader.tsx b/frontend/src/components/auth/AuthPageHeader.tsx
index 3b45a436ce..c44fea9221 100644
--- a/frontend/src/components/auth/AuthPageHeader.tsx
+++ b/frontend/src/components/auth/AuthPageHeader.tsx
@@ -4,7 +4,7 @@ import { Link } from "@tanstack/react-router";
type Props = { children?: ReactNode };
export const AuthPageHeader = ({ children }: Props) => (
- <header className="relative z-10 flex h-16 w-full items-center justify-between">
+ <header className="relative z-10 flex h-16 w-full shrink-0 items-center justify-between px-8 xl:px-12">
<Link to="/">
<img alt="Infisical" src="/images/logotransparent.png" className="h-5" />
</Link>
diff --git a/frontend/src/components/auth/AuthPageLayout.tsx b/frontend/src/components/auth/AuthPageLayout.tsx
index e05903a280..f261ac04d3 100644
--- a/frontend/src/components/auth/AuthPageLayout.tsx
+++ b/frontend/src/components/auth/AuthPageLayout.tsx
@@ -9,6 +9,7 @@ import { AuthPageFooter } from "./AuthPageFooter";
import { AuthPageHeader } from "./AuthPageHeader";
type Props = {
+ anchorBottomContent?: boolean;
/** Per-step overrides for the marketing panel copy; the headline stays fixed. */
aside?: {
eyebrow?: ReactNode;
@@ -23,6 +24,7 @@ type Props = {
};
export const AuthPageLayout = ({
+ anchorBottomContent = false,
aside,
bottomContent,
children,
@@ -44,16 +46,31 @@ export const AuthPageLayout = ({
>
<section
className={cn(
- "flex h-screen min-h-0 thin-scrollbar min-w-0 flex-col overflow-y-auto px-5 sm:px-8 lg:px-10 xl:px-14",
+ "flex h-screen min-h-0 min-w-0 flex-col",
+ anchorBottomContent ? "overflow-hidden" : "thin-scrollbar overflow-y-auto",
isSplit && "lg:border-r lg:border-border"
)}
>
<AuthPageHeader>{headerAction}</AuthPageHeader>
- <main className="flex flex-1 items-center justify-center py-10">
- <div className={cn("w-full max-w-md", contentClassName)}>{children}</div>
+ <main
+ className={cn(
+ "flex flex-1 px-5 py-10 sm:px-8 lg:px-10 xl:px-14",
+ anchorBottomContent
+ ? "min-h-0 thin-scrollbar overflow-x-hidden overflow-y-auto"
+ : "items-center justify-center"
+ )}
+ >
+ <div className={cn("w-full max-w-md", anchorBottomContent && "m-auto", contentClassName)}>
+ {children}
+ </div>
</main>
{(bottomContent || showFooter) && (
- <div className="relative z-10 pb-6 text-center">
+ <div
+ className={cn(
+ "relative z-10 px-5 pb-6 text-center sm:px-8 lg:px-10 xl:px-14",
+ anchorBottomContent && "shrink-0 border-t border-border pt-4"
+ )}
+ >
{bottomContent}
{showFooter && <AuthPageFooter />}
</div>
diff --git a/frontend/src/components/auth/OnboardingPageLayout.tsx b/frontend/src/components/auth/OnboardingPageLayout.tsx
new file mode 100644
index 0000000000..7264673a96
--- /dev/null
+++ b/frontend/src/components/auth/OnboardingPageLayout.tsx
@@ -0,0 +1,117 @@
+import { ComponentProps, ReactNode, useEffect, useRef } from "react";
+import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
+
+import { cn } from "@app/components/v3/utils";
+
+import { AuthPageLayout } from "./AuthPageLayout";
+
+type Props = Omit<ComponentProps<typeof AuthPageLayout>, "children" | "headerAction"> & {
+ children: ReactNode;
+ currentStep: number;
+ totalSteps: number;
+};
+
+const OnboardingProgress = ({
+ currentStep,
+ totalSteps
+}: Pick<Props, "currentStep" | "totalSteps">) => (
+ <div
+ role="progressbar"
+ aria-label={`Step ${currentStep} of ${totalSteps}`}
+ aria-valuemin={1}
+ aria-valuemax={totalSteps}
+ aria-valuenow={currentStep}
+ className="flex items-center gap-1.5"
+ >
+ {Array.from({ length: totalSteps }, (_, index) => {
+ const step = index + 1;
+
+ return (
+ <span
+ key={step}
+ aria-hidden="true"
+ className={cn(
+ "h-4 w-0.5 bg-foreground/10",
+ step < currentStep && "bg-project/40",
+ step === currentStep && "bg-project"
+ )}
+ />
+ );
+ })}
+ </div>
+);
+
+type StepTransitionContext = {
+ direction: number;
+ prefersReducedMotion: boolean;
+};
+
+const stepTransitionVariants = {
+ enter: ({ direction, prefersReducedMotion }: StepTransitionContext) =>
+ prefersReducedMotion
+ ? {
+ opacity: 0
+ }
+ : {
+ transform: `translate3d(${direction * 32}px, 0, 0) scale(1.01)`,
+ opacity: 0.28
+ },
+ center: {
+ transform: "translate3d(0, 0, 0) scale(1)",
+ opacity: 1
+ },
+ exit: {
+ opacity: 0,
+ transition: {
+ duration: 0
+ }
+ }
+};
+
+export const OnboardingPageLayout = ({ children, currentStep, totalSteps, ...props }: Props) => {
+ const previousStepRef = useRef(currentStep);
+ const prefersReducedMotion = useReducedMotion();
+ let direction = 0;
+
+ if (currentStep > previousStepRef.current) {
+ direction = 1;
+ } else if (currentStep < previousStepRef.current) {
+ direction = -1;
+ }
+
+ useEffect(() => {
+ previousStepRef.current = currentStep;
+ }, [currentStep]);
+
+ const transitionContext: StepTransitionContext = {
+ direction,
+ prefersReducedMotion: Boolean(prefersReducedMotion)
+ };
+
+ return (
+ <AuthPageLayout
+ {...props}
+ headerAction={<OnboardingProgress currentStep={currentStep} totalSteps={totalSteps} />}
+ >
+ <div className="relative -m-2 overflow-hidden p-2">
+ <AnimatePresence mode="popLayout" initial={false} custom={transitionContext}>
+ <motion.div
+ key={currentStep}
+ custom={transitionContext}
+ variants={stepTransitionVariants}
+ initial="enter"
+ animate="center"
+ exit="exit"
+ transition={{
+ duration: prefersReducedMotion ? 0.12 : 0.18,
+ ease: [0.23, 1, 0.32, 1]
+ }}
+ className="w-full will-change-transform"
+ >
+ {children}
+ </motion.div>
+ </AnimatePresence>
+ </div>
+ </AuthPageLayout>
+ );
+};
diff --git a/frontend/src/components/auth/OrgNameStep.tsx b/frontend/src/components/auth/OrgNameStep.tsx
index f525377160..8281339b14 100644
--- a/frontend/src/components/auth/OrgNameStep.tsx
+++ b/frontend/src/components/auth/OrgNameStep.tsx
@@ -78,6 +78,7 @@ export default function OrgNameStep({ onComplete }: OrgNameStepProps): JSX.Eleme
Organization Name
</FieldLabel>
<Input
+ variant="outlined"
{...register("organizationName")}
id="sso-organization-name"
placeholder="Organization Name"
diff --git a/frontend/src/components/auth/TeamInviteStep.tsx b/frontend/src/components/auth/TeamInviteStep.tsx
index b6162f3799..95e1c782ec 100644
--- a/frontend/src/components/auth/TeamInviteStep.tsx
+++ b/frontend/src/components/auth/TeamInviteStep.tsx
@@ -143,6 +143,7 @@ export default function TeamInviteStep({
<span className="font-normal text-muted">(optional)</span>
</FieldLabel>
<Input
+ variant="outlined"
id="signup-attribution-source"
value={attributionSource}
onChange={(e) => setAttributionSource(e.target.value)}
diff --git a/frontend/src/components/v2/Breadcrumb/Breadcrumb.tsx b/frontend/src/components/v2/Breadcrumb/Breadcrumb.tsx
index 63d2dc6f4f..ccb94da2b9 100644
--- a/frontend/src/components/v2/Breadcrumb/Breadcrumb.tsx
+++ b/frontend/src/components/v2/Breadcrumb/Breadcrumb.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable react/prop-types */
import React from "react";
import { faCaretDown, faEllipsis } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
diff --git a/frontend/src/components/v3/generic/Accordion/Accordion.tsx b/frontend/src/components/v3/generic/Accordion/Accordion.tsx
index 1a6c1b3e5d..5578a0915a 100644
--- a/frontend/src/components/v3/generic/Accordion/Accordion.tsx
+++ b/frontend/src/components/v3/generic/Accordion/Accordion.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as AccordionPrimitive from "@radix-ui/react-accordion";
import { ChevronDownIcon } from "lucide-react";
diff --git a/frontend/src/components/v3/generic/Alert/Alert.tsx b/frontend/src/components/v3/generic/Alert/Alert.tsx
index a567e34bd6..195bb8b773 100644
--- a/frontend/src/components/v3/generic/Alert/Alert.tsx
+++ b/frontend/src/components/v3/generic/Alert/Alert.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import { cva, type VariantProps } from "cva";
diff --git a/frontend/src/components/v3/generic/AlertDialog/AlertDialog.tsx b/frontend/src/components/v3/generic/AlertDialog/AlertDialog.tsx
index 035f4175e4..6397d987ce 100644
--- a/frontend/src/components/v3/generic/AlertDialog/AlertDialog.tsx
+++ b/frontend/src/components/v3/generic/AlertDialog/AlertDialog.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
diff --git a/frontend/src/components/v3/generic/AnimatedCollapse/AnimatedCollapse.stories.tsx b/frontend/src/components/v3/generic/AnimatedCollapse/AnimatedCollapse.stories.tsx
index 74b7faf96c..09fcf19a91 100644
--- a/frontend/src/components/v3/generic/AnimatedCollapse/AnimatedCollapse.stories.tsx
+++ b/frontend/src/components/v3/generic/AnimatedCollapse/AnimatedCollapse.stories.tsx
@@ -1,13 +1,29 @@
-import { useState } from "react";
+import { useId, useState } from "react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "../Button";
+import { Field, FieldDescription, FieldLabel } from "../Field";
+import { Input } from "../Input";
import { AnimatedCollapse } from "./AnimatedCollapse";
const meta = {
title: "Generic/AnimatedCollapse",
component: AnimatedCollapse,
- tags: ["autodocs"]
+ tags: ["autodocs"],
+ argTypes: {
+ variant: {
+ control: "select",
+ options: ["default", "subtle"]
+ }
+ },
+ parameters: {
+ docs: {
+ description: {
+ component:
+ "Animates a stable block of content when boolean state reveals or hides it. Children remain mounted while collapsed, so local state, effects, subscriptions, and form registration continue. Callers must own hidden-field validation and side effects. Use Accordion when the disclosure owns its trigger; this component does not animate arbitrary height changes while already open."
+ }
+ }
+ }
} satisfies Meta<typeof AnimatedCollapse>;
export default meta;
@@ -20,13 +36,19 @@ export const Default: Story = {
},
render: function Render(args) {
const [isOpen, setIsOpen] = useState(false);
+ const contentId = useId();
return (
<div className="flex w-80 flex-col gap-2">
- <Button onClick={() => setIsOpen((current) => !current)}>
- {isOpen ? "Hide Content" : "Show Content"}
+ <Button
+ className="w-40"
+ aria-controls={contentId}
+ aria-expanded={isOpen}
+ onClick={() => setIsOpen((current) => !current)}
+ >
+ {isOpen ? "Hide content" : "Show content"}
</Button>
- <AnimatedCollapse {...args} isOpen={isOpen}>
+ <AnimatedCollapse {...args} id={contentId} isOpen={isOpen}>
<div className="rounded-md border border-border bg-container p-4 text-sm text-foreground">
Conditionally displayed content expands and collapses without requiring an accordion
trigger.
@@ -36,3 +58,67 @@ export const Default: Story = {
);
}
};
+
+export const Subtle: Story = {
+ name: "Variant: Subtle",
+ args: {
+ isOpen: false,
+ variant: "subtle"
+ },
+ render: function Render(args) {
+ const [isOpen, setIsOpen] = useState(false);
+ const contentId = useId();
+
+ return (
+ <div className="flex w-80 flex-col gap-2">
+ <Button
+ className="w-40"
+ aria-controls={contentId}
+ aria-expanded={isOpen}
+ onClick={() => setIsOpen((current) => !current)}
+ >
+ {isOpen ? "Hide helper text" : "Show helper text"}
+ </Button>
+ <AnimatedCollapse {...args} id={contentId} isOpen={isOpen}>
+ <p className="text-xs text-muted">
+ Use subtle motion for helper text, validation feedback, and other compact content.
+ </p>
+ </AnimatedCollapse>
+ </div>
+ );
+ }
+};
+
+export const PreservesMountedState: Story = {
+ name: "Behavior: Preserves Mounted State",
+ args: {
+ isOpen: false
+ },
+ render: function Render(args) {
+ const [isOpen, setIsOpen] = useState(true);
+ const contentId = useId();
+
+ return (
+ <div className="flex w-80 flex-col gap-2">
+ <Button
+ className="w-40"
+ aria-controls={contentId}
+ aria-expanded={isOpen}
+ onClick={() => setIsOpen((current) => !current)}
+ >
+ {isOpen ? "Hide field" : "Show field"}
+ </Button>
+ <AnimatedCollapse {...args} id={contentId} isOpen={isOpen}>
+ <Field className="py-2">
+ <FieldLabel htmlFor="persistent-value">Persistent value</FieldLabel>
+ <Input id="persistent-value" placeholder="Type something" />
+ <FieldDescription>
+ Type a value, collapse the section, then expand it. The value remains because children
+ stay mounted.
+ </FieldDescription>
+ </Field>
+ </AnimatedCollapse>
+ </div>
+ );
+ }
+};
diff --git a/frontend/src/components/v3/generic/AnimatedCollapse/AnimatedCollapse.tsx b/frontend/src/components/v3/generic/AnimatedCollapse/AnimatedCollapse.tsx
index 0ede529303..8e90e9ffe8 100644
--- a/frontend/src/components/v3/generic/AnimatedCollapse/AnimatedCollapse.tsx
+++ b/frontend/src/components/v3/generic/AnimatedCollapse/AnimatedCollapse.tsx
@@ -1,39 +1,57 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import { cn } from "../../utils";
-type AnimatedCollapseProps = React.ComponentProps<"div"> & {
+type AnimatedCollapseVariant = "default" | "subtle";
+
+type AnimatedCollapseProps = React.ComponentPropsWithoutRef<"div"> & {
isOpen: boolean;
contentClassName?: string;
+ variant?: AnimatedCollapseVariant;
};
-function AnimatedCollapse({
- children,
- className,
- contentClassName,
- isOpen,
- ...props
-}: AnimatedCollapseProps) {
- return (
- <div
- {...props}
- data-slot="animated-collapse"
- data-state={isOpen ? "open" : "closed"}
- aria-hidden={!isOpen}
- // React 18 does not type the inert attribute yet.
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- {...(!isOpen ? { inert: "" as any } : {})}
- className={cn(
- "grid transition-[grid-template-rows,opacity] duration-200 ease-in-out motion-reduce:transition-none",
- isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0",
- className
- )}
- >
- <div className={cn("min-h-0 overflow-hidden", contentClassName)}>{children}</div>
- </div>
- );
-}
-
-export { AnimatedCollapse, type AnimatedCollapseProps };
+const AnimatedCollapse = React.forwardRef<HTMLDivElement, AnimatedCollapseProps>(
+ ({ children, className, contentClassName, isOpen, variant = "default", ...props }, ref) => {
+ const inertProps: { inert?: "" } = isOpen ? {} : { inert: "" };
+ let contentStateClassName = "translate-y-8 scale-95 opacity-0 blur-[16px]";
+
+ if (isOpen) {
+ contentStateClassName = "translate-y-0 scale-100 opacity-100 blur-none";
+ }
+
+ if (variant === "subtle") {
+ contentStateClassName = isOpen ? "translate-y-0 opacity-100" : "translate-y-px opacity-0";
+ }
+
+ return (
+ <div
+ ref={ref}
+ {...props}
+ data-slot="animated-collapse"
+ data-state={isOpen ? "open" : "closed"}
+ data-variant={variant}
+ aria-hidden={!isOpen}
+ {...inertProps}
+ className={cn(
+ "grid transition-[grid-template-rows] duration-200 ease-in-out motion-reduce:transition-none",
+ isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
+ className
+ )}
+ >
+ <div
+ className={cn(
+ "min-h-0 overflow-hidden transition-[all] duration-200 ease-in-out motion-reduce:transition-none",
+ contentStateClassName,
+ contentClassName
+ )}
+ >
+ {children}
+ </div>
+ </div>
+ );
+ }
+);
+
+AnimatedCollapse.displayName = "AnimatedCollapse";
+
+export { AnimatedCollapse, type AnimatedCollapseProps, type AnimatedCollapseVariant };
diff --git a/frontend/src/components/v3/generic/Breadcrumb/Breadcrumb.tsx b/frontend/src/components/v3/generic/Breadcrumb/Breadcrumb.tsx
index 71222d03b6..3faf9ad383 100644
--- a/frontend/src/components/v3/generic/Breadcrumb/Breadcrumb.tsx
+++ b/frontend/src/components/v3/generic/Breadcrumb/Breadcrumb.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { ChevronRight, MoreHorizontal } from "lucide-react";
diff --git a/frontend/src/components/v3/generic/Calendar/Calendar.tsx b/frontend/src/components/v3/generic/Calendar/Calendar.tsx
index 1c97b5feb5..02fbbb8d58 100644
--- a/frontend/src/components/v3/generic/Calendar/Calendar.tsx
+++ b/frontend/src/components/v3/generic/Calendar/Calendar.tsx
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/no-shadow */
/* eslint-disable react/no-unstable-nested-components */
-/* eslint-disable react/prop-types */
import * as React from "react";
import { type DayButton, DayPicker, getDefaultClassNames, type Locale } from "react-day-picker";
diff --git a/frontend/src/components/v3/generic/Card/Card.tsx b/frontend/src/components/v3/generic/Card/Card.tsx
index 8b146c4eab..a8c999d2ca 100644
--- a/frontend/src/components/v3/generic/Card/Card.tsx
+++ b/frontend/src/components/v3/generic/Card/Card.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import { cn } from "../../utils";
diff --git a/frontend/src/components/v3/generic/Checkbox/Checkbox.tsx b/frontend/src/components/v3/generic/Checkbox/Checkbox.tsx
index 490c22e814..49cc252fb0 100644
--- a/frontend/src/components/v3/generic/Checkbox/Checkbox.tsx
+++ b/frontend/src/components/v3/generic/Checkbox/Checkbox.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable react/prop-types */
import * as React from "react";
import { CheckboxIndicator, Root as CheckboxPrimitive } from "@radix-ui/react-checkbox";
import { cva, VariantProps } from "cva";
diff --git a/frontend/src/components/v3/generic/Command/Command.tsx b/frontend/src/components/v3/generic/Command/Command.tsx
index f0e7709529..b6cea4127e 100644
--- a/frontend/src/components/v3/generic/Command/Command.tsx
+++ b/frontend/src/components/v3/generic/Command/Command.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import { Command as CommandPrimitive } from "cmdk";
import { SearchIcon } from "lucide-react";
diff --git a/frontend/src/components/v3/generic/Dialog/Dialog.tsx b/frontend/src/components/v3/generic/Dialog/Dialog.tsx
index 4672892c29..c71a2706b9 100644
--- a/frontend/src/components/v3/generic/Dialog/Dialog.tsx
+++ b/frontend/src/components/v3/generic/Dialog/Dialog.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as DialogPrimitive from "@radix-ui/react-dialog";
import { XIcon } from "lucide-react";
diff --git a/frontend/src/components/v3/generic/Dropdown/Dropdown.tsx b/frontend/src/components/v3/generic/Dropdown/Dropdown.tsx
index 1b65f94299..55ce7b2d55 100644
--- a/frontend/src/components/v3/generic/Dropdown/Dropdown.tsx
+++ b/frontend/src/components/v3/generic/Dropdown/Dropdown.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
import { CheckIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
diff --git a/frontend/src/components/v3/generic/Field/Field.stories.tsx b/frontend/src/components/v3/generic/Field/Field.stories.tsx
index 4ffd7d71d0..e69822a489 100644
--- a/frontend/src/components/v3/generic/Field/Field.stories.tsx
+++ b/frontend/src/components/v3/generic/Field/Field.stories.tsx
@@ -26,6 +26,9 @@ import {
* The `orientation` prop on `Field` switches between `vertical` (default — stacked),
* `horizontal` (label left, control right), and `responsive` (vertical on narrow
* containers, horizontal on wider ones).
+ *
+ * `FieldDescription` keeps its content mounted inside `AnimatedCollapse`. Pass
+ * `isOpen` when helper text should expand or collapse in response to field state.
*/
const meta = {
title: "Generic/Field",
diff --git a/frontend/src/components/v3/generic/Field/Field.tsx b/frontend/src/components/v3/generic/Field/Field.tsx
index b871d253d7..88e039a2ba 100644
--- a/frontend/src/components/v3/generic/Field/Field.tsx
+++ b/frontend/src/components/v3/generic/Field/Field.tsx
@@ -1,10 +1,32 @@
-import { useMemo } from "react";
+import { useMemo, useRef } from "react";
import { cva, type VariantProps } from "cva";
import { cn } from "../../utils";
+import { AnimatedCollapse } from "../AnimatedCollapse";
import { Label } from "../Label";
import { Separator } from "../Separator";
+const hasRenderableContent = (content: React.ReactNode): boolean => {
+ if (Array.isArray(content)) {
+ return content.some(hasRenderableContent);
+ }
+
+ return (
+ content !== null && content !== undefined && typeof content !== "boolean" && content !== ""
+ );
+};
+
+const useRetainedContent = (content: React.ReactNode) => {
+ const hasContent = hasRenderableContent(content);
+ const retainedContent = useRef<React.ReactNode>(hasContent ? content : null);
+
+ if (hasContent) {
+ retainedContent.current = content;
+ }
+
+ return { hasContent, retainedContent: retainedContent.current };
+};
+
function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
return (
<fieldset
@@ -151,17 +173,27 @@ function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
);
}
-function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
+type FieldDescriptionProps = React.ComponentProps<"p"> & {
+ isOpen?: boolean;
+};
+
+function FieldDescription({ children, className, isOpen, ...props }: FieldDescriptionProps) {
+ const { hasContent, retainedContent } = useRetainedContent(children);
+
return (
- <p
- data-slot="field-description"
- className={cn(
- "mt-0.5 text-left text-xs leading-snug font-normal text-muted [[data-variant=legend]+&]:-mt-1.5",
- "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-foreground",
- className
- )}
- {...props}
- />
+ <AnimatedCollapse isOpen={isOpen ?? hasContent} variant="subtle">
+ <p
+ data-slot="field-description"
+ className={cn(
+ "text-left text-2xs leading-snug font-normal text-muted",
+ "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-foreground",
+ className
+ )}
+ {...props}
+ >
+ {retainedContent}
+ </p>
+ </AnimatedCollapse>
);
}
@@ -197,14 +229,12 @@ function FieldSeparator({
);
}
-function FieldError({
- className,
- children,
- errors,
- ...props
-}: React.ComponentProps<"div"> & {
+type FieldErrorProps = React.ComponentProps<"div"> & {
errors?: Array<{ message?: string } | undefined>;
-}) {
+ isOpen?: boolean;
+};
+
+function FieldError({ className, children, errors, isOpen, ...props }: FieldErrorProps) {
const content = useMemo(() => {
if (children) {
return children;
@@ -238,20 +268,19 @@ function FieldError({
</ul>
);
}, [children, errors]);
-
- if (!content) {
- return null;
- }
+ const { hasContent, retainedContent } = useRetainedContent(content);
return (
- <div
- role="alert"
- data-slot="field-error"
- className={cn("mt-0.5 text-xs leading-snug font-normal text-danger", className)}
- {...props}
- >
- {content}
- </div>
+ <AnimatedCollapse isOpen={isOpen ?? hasContent} variant="subtle">
+ <div
+ role="alert"
+ data-slot="field-error"
+ className={cn("mt-0.5 text-xs leading-snug font-normal text-danger", className)}
+ {...props}
+ >
+ {retainedContent}
+ </div>
+ </AnimatedCollapse>
);
}
@@ -259,7 +288,9 @@ export {
Field,
FieldContent,
FieldDescription,
+ type FieldDescriptionProps,
FieldError,
+ type FieldErrorProps,
FieldGroup,
FieldLabel,
FieldLegend,
diff --git a/frontend/src/components/v3/generic/Field/FieldFeedback.stories.tsx b/frontend/src/components/v3/generic/Field/FieldFeedback.stories.tsx
new file mode 100644
index 0000000000..7bfea49b0e
--- /dev/null
+++ b/frontend/src/components/v3/generic/Field/FieldFeedback.stories.tsx
@@ -0,0 +1,94 @@
+import { useState } from "react";
+import type { Meta, StoryObj } from "@storybook/react-vite";
+
+import { Button } from "../Button";
+import { Input } from "../Input";
+import { Field, FieldLabel } from "./Field";
+import { FieldFeedback } from "./FieldFeedback";
+
+const meta = {
+ title: "Generic/Field/FieldFeedback",
+ component: FieldFeedback,
+ tags: ["autodocs"],
+ parameters: {
+ layout: "centered",
+ docs: {
+ description: {
+ component:
+ "Provides one animated message slot beneath a form control. Use it when helper text should be replaced by validation feedback instead of rendering both messages. The wrapper ID associates both states with the control through `aria-describedby`; errors use an alert role. Message and height transitions respect reduced-motion preferences."
+ }
+ }
+ },
+ argTypes: {
+ className: {
+ table: {
+ disable: true
+ }
+ }
+ },
+ globals: {
+ backgrounds: { value: "card" }
+ }
+} satisfies Meta<typeof FieldFeedback>;
+
+export default meta;
+type Story = StoryObj<typeof meta>;
+
+export const Default: Story = {
+ name: "Example: Description",
+ args: {
+ id: "field-feedback-default-message",
+ description: "Leave blank to allow any email domain."
+ },
+ render: (args) => (
+ <Field className="w-96">
+ <FieldLabel htmlFor="field-feedback-default">Allowed email domains</FieldLabel>
+ <Input
+ id="field-feedback-default"
+ aria-describedby="field-feedback-default-message"
+ placeholder="acme.com, example.com"
+ />
+ <FieldFeedback {...args} />
+ </Field>
+ )
+};
+
+export const FeedbackTransition: Story = {
+ name: "Behavior: Description to Error",
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "Toggle the validation state to see the helper text exit before error feedback occupies the same message slot. The field and control expose their invalid state separately; `FieldFeedback` owns only the message transition and announcement."
+ }
+ }
+ },
+ render: function Render() {
+ const [hasError, setHasError] = useState(false);
+
+ return (
+ <Field className="w-96" data-invalid={hasError}>
+ <FieldLabel htmlFor="field-feedback-transition">Allowed email domains</FieldLabel>
+ <Input
+ id="field-feedback-transition"
+ aria-describedby="field-feedback-transition-message"
+ value={hasError ? "anthropic" : ""}
+ isError={hasError}
+ readOnly
+ />
+ <FieldFeedback
+ id="field-feedback-transition-message"
+ description="Leave blank to allow any email domain."
+ error={
+ hasError
+ ? "Enter a complete domain such as anthropic.com. Protocols and paths are not supported."
+ : undefined
+ }
+ />
+ <Button type="button" variant="outline" onClick={() => setHasError((current) => !current)}>
+ {hasError ? "Clear error" : "Show error"}
+ </Button>
+ </Field>
+ );
+ }
+};
diff --git a/frontend/src/components/v3/generic/Field/FieldFeedback.tsx b/frontend/src/components/v3/generic/Field/FieldFeedback.tsx
new file mode 100644
index 0000000000..a783fca5be
--- /dev/null
+++ b/frontend/src/components/v3/generic/Field/FieldFeedback.tsx
@@ -0,0 +1,64 @@
+import * as React from "react";
+import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
+
+import { cn } from "../../utils";
+
+type FieldFeedbackProps = {
+ className?: string;
+ description?: React.ReactNode;
+ error?: React.ReactNode;
+ id?: string;
+};
+
+function FieldFeedback({ className, description, error, id }: FieldFeedbackProps) {
+ const prefersReducedMotion = useReducedMotion();
+ const hasError = error !== null && error !== undefined && error !== false && error !== "";
+ const transition = {
+ duration: prefersReducedMotion ? 0 : 0.15,
+ ease: [0.23, 1, 0.32, 1] as const
+ };
+ const initial = prefersReducedMotion ? { opacity: 1 } : { opacity: 0, y: 2 };
+ const exit = prefersReducedMotion ? { opacity: 1 } : { opacity: 0, y: -2 };
+
+ return (
+ <motion.div
+ id={id}
+ layout="size"
+ data-slot="field-feedback"
+ data-state={hasError ? "error" : "description"}
+ className={cn("grid", className)}
+ transition={transition}
+ >
+ <AnimatePresence initial={false}>
+ {hasError ? (
+ <motion.div
+ key="error"
+ role="alert"
+ data-slot="field-error"
+ className="col-start-1 row-start-1 text-left text-2xs leading-snug font-normal text-danger"
+ initial={initial}
+ animate={{ opacity: 1, y: 0 }}
+ exit={exit}
+ transition={transition}
+ >
+ {error}
+ </motion.div>
+ ) : (
+ <motion.p
+ key="description"
+ data-slot="field-description"
+ className="col-start-1 row-start-1 text-left text-2xs leading-snug font-normal text-muted [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-foreground"
+ initial={initial}
+ animate={{ opacity: 1, y: 0 }}
+ exit={exit}
+ transition={transition}
+ >
+ {description}
+ </motion.p>
+ )}
+ </AnimatePresence>
+ </motion.div>
+ );
+}
+
+export { FieldFeedback, type FieldFeedbackProps };
diff --git a/frontend/src/components/v3/generic/Field/index.ts b/frontend/src/components/v3/generic/Field/index.ts
index cdf384cf7d..99700568e9 100644
--- a/frontend/src/components/v3/generic/Field/index.ts
+++ b/frontend/src/components/v3/generic/Field/index.ts
@@ -1 +1,2 @@
export * from "./Field";
+export * from "./FieldFeedback";
diff --git a/frontend/src/components/v3/generic/HoverCard/HoverCard.tsx b/frontend/src/components/v3/generic/HoverCard/HoverCard.tsx
index 90642dbe9c..046400cb14 100644
--- a/frontend/src/components/v3/generic/HoverCard/HoverCard.tsx
+++ b/frontend/src/components/v3/generic/HoverCard/HoverCard.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
diff --git a/frontend/src/components/v3/generic/IconButton/IconButton.stories.tsx b/frontend/src/components/v3/generic/IconButton/IconButton.stories.tsx
index 059c3eca7c..1a74af72a5 100644
--- a/frontend/src/components/v3/generic/IconButton/IconButton.stories.tsx
+++ b/frontend/src/components/v3/generic/IconButton/IconButton.stories.tsx
@@ -41,6 +41,7 @@ const meta = {
"outline",
"ghost",
"ghost-muted",
+ "neutral",
"success",
"info",
"warning",
@@ -154,6 +155,22 @@ export const GhostMuted: Story = {
}
};
+export const Neutral: Story = {
+ name: "Variant: Neutral",
+ args: {
+ variant: "neutral",
+ "aria-label": "More",
+ children: <MoreHorizontalIcon />
+ },
+ parameters: {
+ docs: {
+ description: {
+ story: "Use for neutral actions that need a subtle filled background."
+ }
+ }
+ }
+};
+
export const Success: Story = {
name: "Variant: Success",
args: {
diff --git a/frontend/src/components/v3/generic/IconButton/IconButton.tsx b/frontend/src/components/v3/generic/IconButton/IconButton.tsx
index 6a4c045e95..938a9d91fe 100644
--- a/frontend/src/components/v3/generic/IconButton/IconButton.tsx
+++ b/frontend/src/components/v3/generic/IconButton/IconButton.tsx
@@ -23,6 +23,8 @@ const iconButtonVariants = cva(
"text-foreground hover:bg-foreground/10 border-transparent data-[state=open]:bg-foreground/10",
"ghost-muted":
"text-muted hover:text-foreground hover:bg-foreground/10 border-transparent data-[state=open]:text-foreground data-[state=open]:bg-foreground/10",
+ neutral:
+ "border-neutral/25 bg-neutral/10 text-foreground hover:bg-neutral/15 hover:border-neutral/30 data-[state=open]:bg-neutral/15 data-[state=open]:border-neutral/30",
project:
"border-project/25 bg-project/10 text-foreground hover:bg-project/15 hover:border-project/30 data-[state=open]:bg-project/15 data-[state=open]:border-project/30",
org: "border-org/25 bg-org/10 text-foreground hover:bg-org/15 hover:border-org/30 data-[state=open]:bg-org/15 data-[state=open]:border-org/30",
diff --git a/frontend/src/components/v3/generic/Input/Input.stories.tsx b/frontend/src/components/v3/generic/Input/Input.stories.tsx
index b8e40e8989..63b26e8adc 100644
--- a/frontend/src/components/v3/generic/Input/Input.stories.tsx
+++ b/frontend/src/components/v3/generic/Input/Input.stories.tsx
@@ -11,7 +11,8 @@ import { Input } from "./Input";
* Use the native `type` attribute for browser-native UX (email keyboards, password
* masking, native date pickers, file selectors). For labels, helper text, and
* validation errors, compose with `Field` / `FieldLabel` / `FieldDescription` /
- * `FieldError` from `../Field` rather than re-inventing the layout.
+ * `FieldError` from `../Field` rather than re-inventing the layout. Input helper
+ * text inherits `FieldDescription`'s default animated-collapse behavior.
*
* The component fills its parent's width by design — let the parent (`Field`,
* `FieldGroup`, or a custom container) decide how wide the input should be.
diff --git a/frontend/src/components/v3/generic/InputGroup/InputGroup.tsx b/frontend/src/components/v3/generic/InputGroup/InputGroup.tsx
index 3593ed732e..6b82ee46b3 100644
--- a/frontend/src/components/v3/generic/InputGroup/InputGroup.tsx
+++ b/frontend/src/components/v3/generic/InputGroup/InputGroup.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable react/prop-types */
import * as React from "react";
import { cva, type VariantProps } from "cva";
@@ -49,7 +48,7 @@ function InputGroup({ className, variant = "default", ...props }: InputGroupProp
}
const inputGroupAddonVariants = cva(
- "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg]:text-accent [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
+ "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm select-none [&>svg]:text-accent [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
{
variants: {
align: {
diff --git a/frontend/src/components/v3/generic/Item/Item.tsx b/frontend/src/components/v3/generic/Item/Item.tsx
index bdf7e046e9..00448acf39 100644
--- a/frontend/src/components/v3/generic/Item/Item.tsx
+++ b/frontend/src/components/v3/generic/Item/Item.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable react/prop-types */
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "cva";
diff --git a/frontend/src/components/v3/generic/Label/Label.tsx b/frontend/src/components/v3/generic/Label/Label.tsx
index bc4f450b5d..71ffaf2225 100644
--- a/frontend/src/components/v3/generic/Label/Label.tsx
+++ b/frontend/src/components/v3/generic/Label/Label.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable react/prop-types */
import * as React from "react";
import * as LabelPrimitive from "@radix-ui/react-label";
@@ -9,7 +8,7 @@ function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimiti
<LabelPrimitive.Root
data-slot="label"
className={cn(
- "flex items-center gap-2 text-sm leading-none font-medium text-foreground select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
+ "flex items-center gap-2 text-sm leading-none text-foreground select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
className
)}
{...props}
diff --git a/frontend/src/components/v3/generic/Popover/Popover.tsx b/frontend/src/components/v3/generic/Popover/Popover.tsx
index 467f282562..cda505afe1 100644
--- a/frontend/src/components/v3/generic/Popover/Popover.tsx
+++ b/frontend/src/components/v3/generic/Popover/Popover.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as PopoverPrimitive from "@radix-ui/react-popover";
diff --git a/frontend/src/components/v3/generic/RadioGroup/RadioGroup.tsx b/frontend/src/components/v3/generic/RadioGroup/RadioGroup.tsx
index ccc3c957c8..095fd835a5 100644
--- a/frontend/src/components/v3/generic/RadioGroup/RadioGroup.tsx
+++ b/frontend/src/components/v3/generic/RadioGroup/RadioGroup.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
@@ -34,7 +32,7 @@ function RadioGroupItem({ className, isError, ...props }: RadioGroupItemProps) {
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
"aria-invalid:border-danger aria-invalid:ring-danger/40",
"hover:border-foreground/30",
- "data-[state=checked]:border-foreground/25 data-[state=checked]:bg-foreground/75",
+ "data-[state=checked]:border-primary data-[state=checked]:bg-primary",
className
)}
{...props}
@@ -43,7 +41,7 @@ function RadioGroupItem({ className, isError, ...props }: RadioGroupItemProps) {
data-slot="radio-group-indicator"
className="flex size-4 items-center justify-center"
>
- <span className="size-2 rounded-full bg-background" />
+ <span className="size-2 rounded-full bg-black" />
</RadioGroupPrimitive.Indicator>
</RadioGroupPrimitive.Item>
);
diff --git a/frontend/src/components/v3/generic/ScrollableContent/ScrollableContent.css b/frontend/src/components/v3/generic/ScrollableContent/ScrollableContent.css
new file mode 100644
index 0000000000..de73e7c972
--- /dev/null
+++ b/frontend/src/components/v3/generic/ScrollableContent/ScrollableContent.css
@@ -0,0 +1,168 @@
+.scrollable-content-viewport {
+ --scrollable-content-edge-size: 2rem;
+ --scrollable-content-size-max-height: clamp(12rem, calc(100dvh - 24rem), 28rem);
+
+ container-name: scrollable-content;
+ container-type: scroll-state;
+ max-height: var(--scrollable-content-max-height, var(--scrollable-content-size-max-height));
+ scrollbar-color: color-mix(in srgb, var(--color-foreground) 24%, transparent) transparent;
+ scrollbar-width: thin;
+}
+
+.scrollable-content-viewport[data-size="sm"] {
+ --scrollable-content-size-max-height: clamp(8rem, calc(100dvh - 32rem), 16rem);
+}
+
+.scrollable-content-viewport[data-size="md"] {
+ --scrollable-content-size-max-height: clamp(10rem, calc(100dvh - 28rem), 22rem);
+}
+
+.scrollable-content-scroller {
+ position: absolute;
+ left: 50%;
+ z-index: 20;
+ visibility: hidden;
+ pointer-events: none;
+ opacity: 0;
+ transition:
+ opacity 150ms ease-in-out,
+ visibility 150ms ease-in-out;
+}
+
+.scrollable-content-scroller[data-scroll-direction="up"] {
+ top: 0;
+ translate: -50% -50%;
+}
+
+.scrollable-content-scroller[data-scroll-direction="down"] {
+ bottom: 0;
+ translate: -50% 50%;
+}
+
+[data-slot="scrollable-content"][data-scrollable-top="true"]
+ > .scrollable-content-scroller[data-scroll-direction="up"],
+[data-slot="scrollable-content"][data-scrollable-bottom="true"]
+ > .scrollable-content-scroller[data-scroll-direction="down"] {
+ visibility: visible;
+ pointer-events: auto;
+ opacity: 1;
+}
+
+.scrollable-content-viewport[data-edge-behavior="fade"][data-scrollable-top="true"][data-scrollable-bottom="true"] {
+ -webkit-mask-image: linear-gradient(
+ to bottom,
+ transparent,
+ black var(--scrollable-content-edge-size),
+ black calc(100% - var(--scrollable-content-edge-size)),
+ transparent
+ );
+ mask-image: linear-gradient(
+ to bottom,
+ transparent,
+ black var(--scrollable-content-edge-size),
+ black calc(100% - var(--scrollable-content-edge-size)),
+ transparent
+ );
+}
+
+.scrollable-content-viewport[data-edge-behavior="fade"][data-scrollable-top="true"][data-scrollable-bottom="false"] {
+ -webkit-mask-image: linear-gradient(
+ to bottom,
+ transparent,
+ black var(--scrollable-content-edge-size)
+ );
+ mask-image: linear-gradient(to bottom, transparent, black var(--scrollable-content-edge-size));
+}
+
+.scrollable-content-viewport[data-edge-behavior="fade"][data-scrollable-top="false"][data-scrollable-bottom="true"] {
+ -webkit-mask-image: linear-gradient(
+ to bottom,
+ black calc(100% - var(--scrollable-content-edge-size)),
+ transparent
+ );
+ mask-image: linear-gradient(
+ to bottom,
+ black calc(100% - var(--scrollable-content-edge-size)),
+ transparent
+ );
+}
+
+.scrollable-content-viewport::-webkit-scrollbar {
+ width: 0.25rem;
+}
+
+.scrollable-content-viewport::-webkit-scrollbar-track {
+ background: transparent;
+}
+
+.scrollable-content-viewport::-webkit-scrollbar-thumb {
+ border-radius: 9999px;
+ background: color-mix(in srgb, var(--color-foreground) 24%, transparent);
+}
+
+.scrollable-content-edge {
+ position: sticky;
+ z-index: 10;
+ height: 0;
+ pointer-events: none;
+ opacity: 0;
+ transition: opacity 150ms ease-in-out;
+}
+
+.scrollable-content-edge::before {
+ position: absolute;
+ right: 0;
+ left: 0;
+ content: "";
+}
+
+.scrollable-content-edge[data-edge="top"] {
+ top: 0;
+}
+
+.scrollable-content-edge[data-edge="bottom"] {
+ top: 100%;
+}
+
+.scrollable-content-viewport[data-edge-behavior="border"] .scrollable-content-edge::before {
+ height: 1px;
+ background-color: var(--color-border);
+}
+
+.scrollable-content-viewport[data-edge-behavior="border"]
+ .scrollable-content-edge[data-edge="top"]::before {
+ top: 0;
+}
+
+.scrollable-content-viewport[data-edge-behavior="border"]
+ .scrollable-content-edge[data-edge="bottom"]::before {
+ bottom: 0;
+}
+
+@container scrollable-content scroll-state(scrollable: top) {
+ .scrollable-content-edge[data-edge="top"] {
+ opacity: 1;
+ }
+}
+
+@container scrollable-content scroll-state(scrollable: bottom) {
+ .scrollable-content-edge[data-edge="bottom"] {
+ opacity: 1;
+ }
+}
+
+@supports not (container-type: scroll-state) {
+ .scrollable-content-viewport[data-scrollable-top="true"]
+ .scrollable-content-edge[data-edge="top"],
+ .scrollable-content-viewport[data-scrollable-bottom="true"]
+ .scrollable-content-edge[data-edge="bottom"] {
+ opacity: 1;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .scrollable-content-edge,
+ .scrollable-content-scroller {
+ transition: none;
+ }
+}
diff --git a/frontend/src/components/v3/generic/ScrollableContent/ScrollableContent.stories.tsx b/frontend/src/components/v3/generic/ScrollableContent/ScrollableContent.stories.tsx
new file mode 100644
index 0000000000..3b3853c99a
--- /dev/null
+++ b/frontend/src/components/v3/generic/ScrollableContent/ScrollableContent.stories.tsx
@@ -0,0 +1,130 @@
+import { useId, useState } from "react";
+import type { Meta, StoryObj } from "@storybook/react-vite";
+
+import { Checkbox } from "../Checkbox";
+import {
+ Field,
+ FieldContent,
+ FieldDescription,
+ FieldGroup,
+ FieldLabel,
+ FieldTitle
+} from "../Field";
+import { ScrollableContent } from "./ScrollableContent";
+
+const options = [
+ ["Email", "Allow users to sign in with an email address and password."],
+ ["Google SSO", "Allow users to sign in with Google."],
+ ["GitHub SSO", "Allow users to sign in with GitHub."],
+ ["GitLab SSO", "Allow users to sign in with GitLab."],
+ ["SAML SSO", "Available after a SAML provider is configured."],
+ ["OIDC SSO", "Available after an OIDC provider is configured."],
+ ["LDAP", "Available after an LDAP provider is configured."]
+] as const;
+
+const meta = {
+ title: "Generic/ScrollableContent",
+ component: ScrollableContent,
+ tags: ["autodocs"],
+ args: {
+ "aria-label": "Authentication methods",
+ edgeBehavior: "none",
+ outline: true,
+ showScrollers: false,
+ size: "lg"
+ },
+ argTypes: {
+ edgeBehavior: {
+ control: "select",
+ options: ["none", "fade", "border"]
+ },
+ size: {
+ control: "select",
+ options: ["sm", "md", "lg"]
+ },
+ outline: {
+ control: "boolean"
+ },
+ showScrollers: {
+ control: "boolean"
+ }
+ },
+ parameters: {
+ docs: {
+ description: {
+ component:
+ "Constrains a vertical content stack, keeps its scrollbar outside the content width, and reveals an edge treatment only while more content is available in that direction. Use it for option stacks or information groups, not for virtualizing large datasets."
+ }
+ }
+ }
+} satisfies Meta<typeof ScrollableContent>;
+
+export default meta;
+type Story = StoryObj<typeof meta>;
+
+export const OptionStack: Story = {
+ render: function Render(args) {
+ const [selected, setSelected] = useState(["Email", "Google SSO", "GitHub SSO"]);
+ const optionIdPrefix = useId();
+
+ return (
+ <ScrollableContent {...args} className="w-xl">
+ <FieldGroup className="gap-1">
+ {options.map(([label, description], index) => {
+ const isChecked = selected.includes(label);
+ const optionId = `${optionIdPrefix}-option-${index}`;
+
+ return (
+ <FieldLabel key={label} htmlFor={optionId}>
+ <Field orientation="horizontal">
+ <FieldContent>
+ <FieldTitle>{label}</FieldTitle>
+ <FieldDescription>{description}</FieldDescription>
+ </FieldContent>
+ <Checkbox
+ id={optionId}
+ aria-label={label}
+ isChecked={isChecked}
+ onCheckedChange={(checked) => {
+ setSelected((current) =>
+ checked ? [...current, label] : current.filter((value) => value !== label)
+ );
+ }}
+ />
+ </Field>
+ </FieldLabel>
+ );
+ })}
+ </FieldGroup>
+ </ScrollableContent>
+ );
+ }
+};
+
+export const BorderEdges: Story = {
+ args: {
+ edgeBehavior: "border"
+ },
+ render: OptionStack.render
+};
+
+export const FadeEdges: Story = {
+ args: {
+ edgeBehavior: "fade"
+ },
+ render: OptionStack.render
+};
+
+export const WithScrollers: Story = {
+ args: {
+ showScrollers: true
+ },
+ render: OptionStack.render
+};
+
+export const WithoutOutline: Story = {
+ args: {
+ outline: false
+ },
+ render: OptionStack.render
+};
diff --git a/frontend/src/components/v3/generic/ScrollableContent/ScrollableContent.tsx b/frontend/src/components/v3/generic/ScrollableContent/ScrollableContent.tsx
new file mode 100644
index 0000000000..960f3adcec
--- /dev/null
+++ b/frontend/src/components/v3/generic/ScrollableContent/ScrollableContent.tsx
@@ -0,0 +1,195 @@
+import * as React from "react";
+import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
+
+import { cn } from "../../utils";
+import { IconButton } from "../IconButton";
+
+import "./ScrollableContent.css";
+
+type ScrollableContentStyle = React.CSSProperties & {
+ "--scrollable-content-max-height"?: string;
+};
+
+type ScrollableContentSize = "sm" | "md" | "lg";
+
+type ScrollableContentProps = Omit<React.ComponentPropsWithoutRef<"div">, "aria-label"> & {
+ "aria-label": string;
+ maxHeight?: React.CSSProperties["maxHeight"];
+ size?: ScrollableContentSize;
+ edgeBehavior?: "none" | "fade" | "border";
+ outline?: boolean;
+ showScrollers?: boolean;
+ containerClassName?: string;
+ contentClassName?: string;
+};
+
+const ScrollableContent = React.forwardRef<HTMLDivElement, ScrollableContentProps>(
+ (
+ {
+ children,
+ className,
+ containerClassName,
+ contentClassName,
+ edgeBehavior = "none",
+ maxHeight,
+ outline = true,
+ showScrollers = false,
+ size = "lg",
+ onScroll,
+ style,
+ ...props
+ },
+ forwardedRef
+ ) => {
+ const viewportRef = React.useRef<HTMLDivElement | null>(null);
+ const contentRef = React.useRef<HTMLDivElement | null>(null);
+ const [scrollability, setScrollability] = React.useState({
+ top: false,
+ bottom: false
+ });
+
+ const updateScrollability = React.useCallback(() => {
+ const viewport = viewportRef.current;
+ if (!viewport) return;
+
+ const nextScrollability = {
+ top: viewport.scrollTop > 1,
+ bottom: viewport.scrollTop + viewport.clientHeight < viewport.scrollHeight - 1
+ };
+
+ setScrollability((current) =>
+ current.top === nextScrollability.top && current.bottom === nextScrollability.bottom
+ ? current
+ : nextScrollability
+ );
+ }, []);
+
+ const setViewportRef = React.useCallback(
+ (node: HTMLDivElement | null) => {
+ viewportRef.current = node;
+
+ if (typeof forwardedRef === "function") {
+ forwardedRef(node);
+ } else if (forwardedRef) {
+ Object.assign(forwardedRef, { current: node });
+ }
+ },
+ [forwardedRef]
+ );
+
+ React.useLayoutEffect(() => {
+ const viewport = viewportRef.current;
+ const content = contentRef.current;
+ if (!viewport || !content) return undefined;
+
+ updateScrollability();
+
+ const resizeObserver = new ResizeObserver(updateScrollability);
+ resizeObserver.observe(viewport);
+ resizeObserver.observe(content);
+
+ return () => resizeObserver.disconnect();
+ }, [updateScrollability]);
+
+ const scrollableStyle: ScrollableContentStyle = {
+ ...style,
+ ...(maxHeight !== undefined
+ ? {
+ "--scrollable-content-max-height":
+ typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight
+ }
+ : {})
+ };
+
+ const scrollByViewport = (direction: "up" | "down") => {
+ const viewport = viewportRef.current;
+ if (!viewport) return;
+
+ const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
+
+ viewport.scrollBy({
+ top: viewport.clientHeight * (direction === "up" ? -1 : 1),
+ behavior: prefersReducedMotion ? "auto" : "smooth"
+ });
+ };
+
+ return (
+ <div
+ data-slot="scrollable-content"
+ data-scrollable-top={scrollability.top}
+ data-scrollable-bottom={scrollability.bottom}
+ className={cn(
+ "relative min-w-0",
+ outline && "rounded-md outline-1 outline-offset-4 outline-accent/60 outline-solid",
+ containerClassName
+ )}
+ >
+ <div
+ ref={setViewportRef}
+ role="region"
+ // Scroll regions must be keyboard reachable, including when their children are informational.
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
+ tabIndex={0}
+ data-slot="scrollable-content-viewport"
+ data-size={size}
+ data-edge-behavior={edgeBehavior}
+ data-scrollable-top={scrollability.top}
+ data-scrollable-bottom={scrollability.bottom}
+ className={cn(
+ "scrollable-content-viewport min-h-0 overflow-x-hidden overflow-y-auto outline-none focus-visible:ring-1 focus-visible:ring-ring",
+ outline && "rounded-md",
+ className
+ )}
+ style={scrollableStyle}
+ onScroll={(event) => {
+ updateScrollability();
+ onScroll?.(event);
+ }}
+ {...props}
+ >
+ {edgeBehavior === "border" && (
+ <>
+ <div aria-hidden data-edge="top" className="scrollable-content-edge" />
+ <div aria-hidden data-edge="bottom" className="scrollable-content-edge" />
+ </>
+ )}
+ <div ref={contentRef} data-slot="scrollable-content-content" className={contentClassName}>
+ {children}
+ </div>
+ </div>
+ {showScrollers && (
+ <>
+ <IconButton
+ type="button"
+ size="xs"
+ variant="neutral"
+ aria-label="Scroll up"
+ data-scroll-direction="up"
+ isDisabled={!scrollability.top}
+ className="scrollable-content-scroller shadow-md"
+ onClick={() => scrollByViewport("up")}
+ >
+ <ChevronUpIcon />
+ </IconButton>
+ <IconButton
+ type="button"
+ size="xs"
+ variant="neutral"
+ aria-label="Scroll down"
+ data-scroll-direction="down"
+ isDisabled={!scrollability.bottom}
+ className="scrollable-content-scroller shadow-md"
+ onClick={() => scrollByViewport("down")}
+ >
+ <ChevronDownIcon />
+ </IconButton>
+ </>
+ )}
+ </div>
+ );
+ }
+);
+
+ScrollableContent.displayName = "ScrollableContent";
+
+export { ScrollableContent, type ScrollableContentProps, type ScrollableContentSize };
diff --git a/frontend/src/components/v3/generic/ScrollableContent/index.ts b/frontend/src/components/v3/generic/ScrollableContent/index.ts
new file mode 100644
index 0000000000..4531f6bf55
--- /dev/null
+++ b/frontend/src/components/v3/generic/ScrollableContent/index.ts
@@ -0,0 +1 @@
+export * from "./ScrollableContent";
diff --git a/frontend/src/components/v3/generic/Select/Select.tsx b/frontend/src/components/v3/generic/Select/Select.tsx
index 2af49c5afb..220d9562e9 100644
--- a/frontend/src/components/v3/generic/Select/Select.tsx
+++ b/frontend/src/components/v3/generic/Select/Select.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as SelectPrimitive from "@radix-ui/react-select";
import { cva, type VariantProps } from "cva";
diff --git a/frontend/src/components/v3/generic/Separator/Separator.tsx b/frontend/src/components/v3/generic/Separator/Separator.tsx
index c25955d90e..b6f3c10c56 100644
--- a/frontend/src/components/v3/generic/Separator/Separator.tsx
+++ b/frontend/src/components/v3/generic/Separator/Separator.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as SeparatorPrimitive from "@radix-ui/react-separator";
diff --git a/frontend/src/components/v3/generic/Sheet/Sheet.tsx b/frontend/src/components/v3/generic/Sheet/Sheet.tsx
index dfb7b29351..f6b7152492 100644
--- a/frontend/src/components/v3/generic/Sheet/Sheet.tsx
+++ b/frontend/src/components/v3/generic/Sheet/Sheet.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
"use client";
import * as React from "react";
diff --git a/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx b/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx
index b1cf603fd8..892ab8030e 100644
--- a/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx
+++ b/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "cva";
diff --git a/frontend/src/components/v3/generic/Stepper/Stepper.tsx b/frontend/src/components/v3/generic/Stepper/Stepper.tsx
index 725451f402..8c89cc72c5 100644
--- a/frontend/src/components/v3/generic/Stepper/Stepper.tsx
+++ b/frontend/src/components/v3/generic/Stepper/Stepper.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import { cva, type VariantProps } from "cva";
import { AlertCircle, Check } from "lucide-react";
diff --git a/frontend/src/components/v3/generic/Switch/Switch.tsx b/frontend/src/components/v3/generic/Switch/Switch.tsx
index 9eacad2720..d3e78e7d81 100644
--- a/frontend/src/components/v3/generic/Switch/Switch.tsx
+++ b/frontend/src/components/v3/generic/Switch/Switch.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as SwitchPrimitive from "@radix-ui/react-switch";
import { cva, VariantProps } from "cva";
diff --git a/frontend/src/components/v3/generic/Table/Table.tsx b/frontend/src/components/v3/generic/Table/Table.tsx
index c049da98e2..e2b8e26355 100644
--- a/frontend/src/components/v3/generic/Table/Table.tsx
+++ b/frontend/src/components/v3/generic/Table/Table.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import { cn } from "@app/components/v3/utils";
diff --git a/frontend/src/components/v3/generic/Tabs/Tabs.tsx b/frontend/src/components/v3/generic/Tabs/Tabs.tsx
index bab83fa85e..4a2e632d6c 100644
--- a/frontend/src/components/v3/generic/Tabs/Tabs.tsx
+++ b/frontend/src/components/v3/generic/Tabs/Tabs.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as TabsPrimitive from "@radix-ui/react-tabs";
import { cva, type VariantProps } from "cva";
diff --git a/frontend/src/components/v3/generic/TextArea/TextArea.tsx b/frontend/src/components/v3/generic/TextArea/TextArea.tsx
index 9bbec3c40b..51669e40fc 100644
--- a/frontend/src/components/v3/generic/TextArea/TextArea.tsx
+++ b/frontend/src/components/v3/generic/TextArea/TextArea.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable react/prop-types */
import * as React from "react";
import { cva, type VariantProps } from "cva";
diff --git a/frontend/src/components/v3/generic/Tooltip/Tooltip.tsx b/frontend/src/components/v3/generic/Tooltip/Tooltip.tsx
index 8b452a541b..27622813aa 100644
--- a/frontend/src/components/v3/generic/Tooltip/Tooltip.tsx
+++ b/frontend/src/components/v3/generic/Tooltip/Tooltip.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable react/prop-types */
-
import * as React from "react";
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
diff --git a/frontend/src/components/v3/generic/index.ts b/frontend/src/components/v3/generic/index.ts
index 41426a83fb..c9f90b486d 100644
--- a/frontend/src/components/v3/generic/index.ts
+++ b/frontend/src/components/v3/generic/index.ts
@@ -30,6 +30,7 @@ export * from "./Pagination";
export * from "./Popover";
export * from "./RadioGroup";
export * from "./ReactSelect";
+export * from "./ScrollableContent";
export * from "./Select";
export * from "./SelectedActionBar";
export * from "./Separator";
diff --git a/frontend/src/helpers/email.ts b/frontend/src/helpers/email.ts
index 771b82e29f..5125ceeb13 100644
--- a/frontend/src/helpers/email.ts
+++ b/frontend/src/helpers/email.ts
@@ -8,10 +8,11 @@ const EmailSchema = z.string().email().min(1).trim().toLowerCase();
// caught inline instead of failing with a 400 (bad domain) or 500 (too long) from the API.
const MAX_EMAIL_LENGTH = 255;
const MAX_DOMAIN_LABEL_LENGTH = 63;
+const MAX_ALLOWED_EMAIL_DOMAINS_LENGTH = 255;
const DOMAIN_LABEL_REGEX = /^[a-zA-Z0-9-]+$/;
const TLD_REGEX = /^[a-zA-Z0-9]+$/;
-const isValidEmailDomain = (domain: string) => {
+export const isValidEmailDomain = (domain: string) => {
const labels = domain.split(".");
if (labels.length < 2) return false;
@@ -28,6 +29,51 @@ const isValidEmailDomain = (domain: string) => {
);
};
+const getDomainEntries = (value: string) =>
+ value
+ .split(",")
+ .map((domain) => domain.trim())
+ .filter(Boolean);
+
+const normalizeDomain = (domain: string) => domain.replace(/^@/, "").trim().toLowerCase();
+
+export const normalizeAllowedEmailDomains = (value: string) =>
+ Array.from(new Set(getDomainEntries(value).map(normalizeDomain))).join(", ");
+
+export const allowedEmailDomainsSchema = z
+ .string()
+ .superRefine((value, context) => {
+ const domainEntries = getDomainEntries(value);
+ const invalidDomains = domainEntries.filter(
+ (domain) => !isValidEmailDomain(normalizeDomain(domain))
+ );
+
+ if (value.trim() && !domainEntries.length) {
+ context.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: "Enter at least one valid email domain"
+ });
+ }
+
+ if (invalidDomains.length) {
+ context.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: `Invalid email domain${invalidDomains.length > 1 ? "s" : ""}: ${invalidDomains.join(", ")}`
+ });
+ }
+
+ if (normalizeAllowedEmailDomains(value).length > MAX_ALLOWED_EMAIL_DOMAINS_LENGTH) {
+ context.addIssue({
+ code: z.ZodIssueCode.too_big,
+ maximum: MAX_ALLOWED_EMAIL_DOMAINS_LENGTH,
+ inclusive: true,
+ type: "string",
+ message: `Email domains must be ${MAX_ALLOWED_EMAIL_DOMAINS_LENGTH} characters or fewer`
+ });
+ }
+ })
+ .transform(normalizeAllowedEmailDomains);
+
export const isValidEmail = (email: string) =>
email.length <= MAX_EMAIL_LENGTH &&
EmailSchema.safeParse(email).success &&
diff --git a/frontend/src/hooks/api/admin/mutation.ts b/frontend/src/hooks/api/admin/mutation.ts
index 8517254071..2381d5e2f9 100644
--- a/frontend/src/hooks/api/admin/mutation.ts
+++ b/frontend/src/hooks/api/admin/mutation.ts
@@ -37,10 +37,13 @@ export const useCreateAdminUser = () => {
});
};
-export const useUpdateServerConfig = () => {
+export const useUpdateServerConfig = ({
+ handledErrorCodes
+}: { handledErrorCodes?: string[] } = {}) => {
const queryClient = useQueryClient();
return useMutation<TServerConfig, object, TUpdateServerConfigDTO>({
+ meta: handledErrorCodes?.length ? { handledErrorCodes } : undefined,
mutationFn: async (opt) => {
const { data } = await apiRequest.patch<{ config: TServerConfig }>(
"/api/v1/admin/config",
diff --git a/frontend/src/hooks/api/admin/types.ts b/frontend/src/hooks/api/admin/types.ts
index 4ccc637f29..311675e1f7 100644
--- a/frontend/src/hooks/api/admin/types.ts
+++ b/frontend/src/hooks/api/admin/types.ts
@@ -13,6 +13,10 @@ export enum LoginMethod {
OIDC = "oidc"
}
+export enum SuperAdminErrorCode {
+ AuthMethodLockout = "SUPER_ADMIN_AUTH_METHOD_LOCKOUT"
+}
+
export type TPasswordPolicyRequirement = {
code: string;
message: string;
@@ -74,7 +78,7 @@ export type TServerConfig = {
defaultAuthOrgId: string | null;
defaultAuthOrgAuthMethod?: string | null;
defaultAuthOrgAuthEnforced?: boolean | null;
- enabledLoginMethods: LoginMethod[];
+ enabledLoginMethods: LoginMethod[] | null;
passwordPolicy: TPasswordPolicy;
authConsentContent?: string;
pageFrameContent?: string;
@@ -91,6 +95,7 @@ export type TServerConfig = {
trustSamlEmails?: boolean;
trustLdapEmails?: boolean;
trustOidcEmails?: boolean;
+ onboardingCompleted?: boolean;
isSecretScanningDisabled?: boolean;
kubernetesAutoFetchServiceAccountToken?: boolean;
isMigrationModeOn?: boolean;
@@ -118,6 +123,7 @@ export type TCreateAdminUserDTO = {
password: string;
firstName: string;
lastName?: string;
+ organizationName?: string;
};
export type AdminGetOrganizationsFilters = {
diff --git a/frontend/src/hooks/api/reactQuery.tsx b/frontend/src/hooks/api/reactQuery.tsx
index 96aa61405e..29ea9b9fdc 100644
--- a/frontend/src/hooks/api/reactQuery.tsx
+++ b/frontend/src/hooks/api/reactQuery.tsx
@@ -95,6 +95,16 @@ export const onRequestError = (
) => {
if (axios.isAxiosError(error)) {
const serverResponse = error.response?.data as TApiErrors;
+ const handledErrorCodes = mutation?.meta?.handledErrorCodes;
+
+ if (
+ typeof serverResponse?.error === "string" &&
+ Array.isArray(handledErrorCodes) &&
+ handledErrorCodes.includes(serverResponse.error)
+ ) {
+ return;
+ }
+
if (serverResponse?.error === ApiErrorTypes.ValidationError) {
if (mutation?.meta?.skipValidationToast) {
return;
diff --git a/frontend/src/hooks/api/users/index.tsx b/frontend/src/hooks/api/users/index.tsx
index 13e27390fb..3d3dfc1fe1 100644
--- a/frontend/src/hooks/api/users/index.tsx
+++ b/frontend/src/hooks/api/users/index.tsx
@@ -28,6 +28,7 @@ export {
useListUserGroupMemberships,
useLogoutUser,
useRegisterUserAction,
+ useRenameUser,
useRevokeMySessions,
useUpdateOrgMembership,
useUpdateUserAuthMethods
diff --git a/frontend/src/hooks/index.ts b/frontend/src/hooks/index.ts
index 8cd9cbba33..63b091d9ab 100644
--- a/frontend/src/hooks/index.ts
+++ b/frontend/src/hooks/index.ts
@@ -6,6 +6,7 @@ export { useDebounce } from "./useDebounce";
export * from "./useGetProjectTypeFromRoute";
export { useLastLogin } from "./useLastLogin";
export { useLocalStorageState } from "./useLocalStorageState";
+export { useOnboarding } from "./useOnboarding";
export { usePagination } from "./usePagination";
export { usePersistentState } from "./usePersistentState";
export { usePopUp } from "./usePopUp";
diff --git a/frontend/src/hooks/useOnboarding.ts b/frontend/src/hooks/useOnboarding.ts
new file mode 100644
index 0000000000..0f32b78d75
--- /dev/null
+++ b/frontend/src/hooks/useOnboarding.ts
@@ -0,0 +1,100 @@
+import { useCallback, useState } from "react";
+
+type TUseOnboardingOptions<TStep extends string> = {
+ id: string;
+ progressScope?: string;
+ steps: readonly [TStep, ...TStep[]];
+ initialStep?: TStep;
+ persistLocally?: boolean;
+ completionFlag?: boolean;
+ onPersistCompletion?: () => Promise<void>;
+ onComplete?: () => Promise<void> | void;
+};
+
+const getStorageKey = (id: string, progressScope?: string) =>
+ `infisical:onboarding:${id}${progressScope ? `:${progressScope}` : ""}:step`;
+
+const getStoredStep = <TStep extends string>(
+ storageKey: string,
+ steps: readonly [TStep, ...TStep[]],
+ fallbackStep: TStep
+) => {
+ try {
+ const storedStep = localStorage.getItem(storageKey);
+ return storedStep && steps.includes(storedStep as TStep) ? (storedStep as TStep) : fallbackStep;
+ } catch {
+ return fallbackStep;
+ }
+};
+
+export const useOnboarding = <TStep extends string>({
+ id,
+ progressScope,
+ steps,
+ initialStep = steps[0],
+ persistLocally = false,
+ completionFlag = false,
+ onPersistCompletion,
+ onComplete
+}: TUseOnboardingOptions<TStep>) => {
+ const storageKey = getStorageKey(id, progressScope);
+ const [activeStep, setActiveStepState] = useState<TStep>(() =>
+ persistLocally ? getStoredStep(storageKey, steps, initialStep) : initialStep
+ );
+ const [isCompleting, setIsCompleting] = useState(false);
+
+ const setActiveStep = useCallback(
+ (step: TStep) => {
+ setActiveStepState(step);
+ if (persistLocally) {
+ try {
+ localStorage.setItem(storageKey, step);
+ } catch {
+ // Local progress is best-effort and must not block the onboarding flow.
+ }
+ }
+ },
+ [persistLocally, storageKey]
+ );
+
+ const activeStepIndex = steps.indexOf(activeStep);
+
+ const next = useCallback(() => {
+ const nextStep = steps[activeStepIndex + 1];
+ if (nextStep) setActiveStep(nextStep);
+ }, [activeStepIndex, setActiveStep, steps]);
+
+ const back = useCallback(() => {
+ const previousStep = steps[activeStepIndex - 1];
+ if (previousStep) setActiveStep(previousStep);
+ }, [activeStepIndex, setActiveStep, steps]);
+
+ const complete = useCallback(async () => {
+ setIsCompleting(true);
+ try {
+ if (completionFlag) {
+ await onPersistCompletion?.();
+ }
+ if (persistLocally) {
+ try {
+ localStorage.removeItem(storageKey);
+ } catch {
+ // Local progress is best-effort and must not block completion.
+ }
+ }
+ await onComplete?.();
+ } finally {
+ setIsCompleting(false);
+ }
+ }, [completionFlag, onComplete, onPersistCompletion, persistLocally, storageKey]);
+
+ return {
+ activeStep,
+ activeStepIndex,
+ back,
+ complete,
+ isCompleting,
+ next,
+ setActiveStep
+ };
+};
diff --git a/frontend/src/index.css b/frontend/src/index.css
index e99c4e60f2..608ea3df8f 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -74,6 +74,8 @@
sans-serif;
--font-inter: "Inter", sans-serif;
--font-jetbrains-mono: "JetBrains Mono", monospace;
+ --text-2xs: 0.7rem;
+ --text-2xs--line-height: 1rem;
--max-width-8xl: 88rem; /* 1408px */
/* Colors v2 */
diff --git a/frontend/src/lib/schemas/slugSchema.ts b/frontend/src/lib/schemas/slugSchema.ts
index 5a02c6a286..fece3f34f2 100644
--- a/frontend/src/lib/schemas/slugSchema.ts
+++ b/frontend/src/lib/schemas/slugSchema.ts
@@ -7,6 +7,8 @@ interface SlugSchemaInputs {
field?: string;
}
+export const normalizeSlugInput = (value: string) => value.toLowerCase().replace(/\s+/g, "-");
+
export const slugSchema = ({ min = 1, max = 64, field = "Slug" }: SlugSchemaInputs = {}) => {
return z
.string()
diff --git a/frontend/src/pages/admin/GeneralPage/components/GeneralPageForm.tsx b/frontend/src/pages/admin/GeneralPage/components/GeneralPageForm.tsx
index 07663ab57c..4d298e3f55 100644
--- a/frontend/src/pages/admin/GeneralPage/components/GeneralPageForm.tsx
+++ b/frontend/src/pages/admin/GeneralPage/components/GeneralPageForm.tsx
@@ -8,13 +8,11 @@ import {
Button,
Card,
CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
Field,
FieldContent,
FieldDescription,
FieldError,
+ FieldFeedback,
FieldGroup,
FieldLabel,
FieldTitle,
@@ -31,6 +29,7 @@ import {
TextArea
} from "@app/components/v3";
import { useServerConfig } from "@app/context";
+import { allowedEmailDomainsSchema } from "@app/helpers/email";
import { useGetOrganizations, useUpdateServerConfig } from "@app/hooks/api";
enum SignUpModes {
@@ -40,7 +39,7 @@ enum SignUpModes {
const formSchema = z.object({
signUpMode: z.nativeEnum(SignUpModes),
- allowedSignUpDomain: z.string().optional().nullable(),
+ allowedSignUpDomain: allowedEmailDomainsSchema.optional().nullable(),
trustSamlEmails: z.boolean(),
trustLdapEmails: z.boolean(),
trustOidcEmails: z.boolean(),
@@ -108,12 +107,6 @@ export const GeneralPageForm = () => {
return (
<Card>
- <CardHeader>
- <CardTitle>Instance Settings</CardTitle>
- <CardDescription>
- Configure signups, authentication defaults, trusted identities, and instance notices.
- </CardDescription>
- </CardHeader>
<CardContent>
<form onSubmit={handleSubmit(onFormSubmit)}>
<FieldGroup>
@@ -148,7 +141,7 @@ export const GeneralPageForm = () => {
defaultValue=""
name="allowedSignUpDomain"
render={({ field, fieldState: { error } }) => (
- <Field className="max-w-sm">
+ <Field className="max-w-sm" data-invalid={Boolean(error)}>
<FieldLabel htmlFor="allowed-signup-domains">Allowed email domains</FieldLabel>
<InputGroup>
<InputGroupAddon>
@@ -157,12 +150,17 @@ export const GeneralPageForm = () => {
<InputGroupInput
id="allowed-signup-domains"
{...field}
+ aria-describedby="allowed-signup-domains-feedback"
+ isError={Boolean(error)}
value={field.value || ""}
placeholder="gmail.com, aws.com, redhat.com"
/>
</InputGroup>
- <FieldDescription>Leave blank to allow any email domain.</FieldDescription>
- <FieldError>{error?.message}</FieldError>
+ <FieldFeedback
+ id="allowed-signup-domains-feedback"
+ description="Leave blank to allow any email domain."
+ error={error?.message}
+ />
</Field>
)}
/>
diff --git a/frontend/src/pages/admin/SetupPage/SetupPage.tsx b/frontend/src/pages/admin/SetupPage/SetupPage.tsx
new file mode 100644
index 0000000000..862f4d9e8b
--- /dev/null
+++ b/frontend/src/pages/admin/SetupPage/SetupPage.tsx
@@ -0,0 +1,608 @@
+import { Helmet } from "react-helmet";
+import { Controller, type Resolver, useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { useNavigate, useRouter } from "@tanstack/react-router";
+import axios from "axios";
+import { Check, ChevronLeft, ChevronRight, type LucideIcon, Mail } from "lucide-react";
+import { z } from "zod";
+
+import { AuthPagePanel } from "@app/components/auth/AuthPagePanel";
+import { OnboardingPageLayout } from "@app/components/auth/OnboardingPageLayout";
+import {
+ AnimatedCollapse,
+ Button,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Checkbox,
+ Field,
+ FieldContent,
+ FieldDescription,
+ FieldError,
+ FieldFeedback,
+ FieldGroup,
+ FieldLabel,
+ FieldTitle,
+ Input,
+ RadioGroup,
+ RadioGroupItem,
+ Separator
+} from "@app/components/v3";
+import { cn } from "@app/components/v3/utils";
+import { useOrganization, useServerConfig, useUser } from "@app/context";
+import { allowedEmailDomainsSchema, normalizeAllowedEmailDomains } from "@app/helpers/email";
+import { useOnboarding } from "@app/hooks";
+import { useRenameUser, useUpdateOrg, useUpdateServerConfig } from "@app/hooks/api";
+import { LoginMethod, SuperAdminErrorCode } from "@app/hooks/api/admin/types";
+import { GenericResourceNameSchema, normalizeSlugInput, slugSchema } from "@app/lib/schemas";
+
+enum SetupStep {
+ Account = "account",
+ Organization = "organization",
+ Access = "access",
+ Review = "review"
+}
+
+enum SignUpMode {
+ Disabled = "disabled",
+ Anyone = "anyone"
+}
+
+const steps = [
+ SetupStep.Account,
+ SetupStep.Organization,
+ SetupStep.Access,
+ SetupStep.Review
+] as const;
+const setupFormId = "self-hosted-server-setup-form";
+
+const formSchema = z.object({
+ firstName: z.string().trim().min(1, "First name is required"),
+ lastName: z.string().trim().optional(),
+ organizationName: GenericResourceNameSchema,
+ organizationSlug: slugSchema({ field: "Organization slug" }),
+ signUpMode: z.nativeEnum(SignUpMode),
+ allowedSignUpDomain: allowedEmailDomainsSchema,
+ enabledLoginMethods: z.nativeEnum(LoginMethod).array().min(1, "Select at least one login method.")
+});
+
+type TSetupForm = z.infer<typeof formSchema>;
+
+const stepSchemas = {
+ [SetupStep.Account]: formSchema.pick({ firstName: true, lastName: true }).passthrough(),
+ [SetupStep.Organization]: formSchema
+ .pick({ organizationName: true, organizationSlug: true })
+ .passthrough(),
+ [SetupStep.Access]: formSchema
+ .pick({ signUpMode: true, allowedSignUpDomain: true, enabledLoginMethods: true })
+ .passthrough(),
+ [SetupStep.Review]: formSchema
+};
+
+const loginMethods: Array<{
+ value: LoginMethod;
+ label: string;
+ icon?: LucideIcon;
+ imageSrc?: string;
+}> = [
+ {
+ value: LoginMethod.EMAIL,
+ label: "Email",
+ icon: Mail
+ },
+ {
+ value: LoginMethod.GOOGLE,
+ label: "Google",
+ imageSrc: "/images/sso/Google.png"
+ },
+ {
+ value: LoginMethod.GITHUB,
+ label: "GitHub",
+ imageSrc: "/images/integrations/GitHub.png"
+ },
+ {
+ value: LoginMethod.GITLAB,
+ label: "GitLab",
+ imageSrc: "/images/integrations/GitLab.png"
+ }
+];
+
+const formatAllowedDomains = (domains: string) =>
+ normalizeAllowedEmailDomains(domains)
+ .split(", ")
+ .filter(Boolean)
+ .map((domain) => `@${domain}`)
+ .join(", ");
+
+const stepContent = {
+ [SetupStep.Account]: {
+ title: "Create a Super Admin account",
+ description: "This account will serve as an instance administrator."
+ },
+ [SetupStep.Organization]: {
+ title: "Set up first org",
+ description: "Each instance can hold multiple orgs, this one is for you."
+ },
+ [SetupStep.Access]: {
+ title: "Control who can join",
+ description: "Choose whether new users can create accounts on this instance."
+ },
+ [SetupStep.Review]: {
+ title: "Review your settings",
+ description: "Confirm the initial access and authentication configuration."
+ }
+} satisfies Record<SetupStep, { title: string; description: string }>;
+
+export const SetupPage = () => {
+ const navigate = useNavigate();
+ const router = useRouter();
+ const { config } = useServerConfig();
+ const { user } = useUser();
+ const { currentOrg } = useOrganization();
+ const { mutateAsync: renameUser } = useRenameUser();
+ const { mutateAsync: updateOrg } = useUpdateOrg();
+ const { mutateAsync: updateServerConfig } = useUpdateServerConfig({
+ handledErrorCodes: [SuperAdminErrorCode.AuthMethodLockout]
+ });
+
+ const { activeStep, activeStepIndex, back, complete, isCompleting, next, setActiveStep } =
+ useOnboarding({
+ id: "self-hosted-server-setup",
+ progressScope: user.id,
+ steps,
+ initialStep: SetupStep.Access,
+ persistLocally: true,
+ completionFlag: true,
+ onPersistCompletion: async () => {
+ await updateServerConfig({ onboardingCompleted: true });
+ },
+ onComplete: async () => {
+ await router.invalidate();
+ await navigate({ to: "/admin/welcome" });
+ }
+ });
+
+ const {
+ clearErrors,
+ control,
+ handleSubmit,
+ register,
+ setError,
+ watch,
+ formState: { dirtyFields, errors, isSubmitting }
+ } = useForm<TSetupForm>({
+ resolver: zodResolver(stepSchemas[activeStep]) as Resolver<TSetupForm>,
+ defaultValues: {
+ firstName: user.firstName ?? "",
+ lastName: user.lastName ?? "",
+ organizationName: currentOrg.name,
+ organizationSlug: currentOrg.slug,
+ signUpMode: config.allowSignUp ? SignUpMode.Anyone : SignUpMode.Disabled,
+ allowedSignUpDomain: config.allowedSignUpDomain ?? "",
+ enabledLoginMethods:
+ config.enabledLoginMethods === null
+ ? loginMethods.map(({ value }) => value)
+ : config.enabledLoginMethods
+ }
+ });
+
+ const values = watch();
+ const onSubmit = handleSubmit(async (formData) => {
+ if (activeStep === SetupStep.Account) {
+ await renameUser({
+ newName: [formData.firstName, formData.lastName].filter(Boolean).join(" ")
+ });
+ next();
+ return;
+ }
+
+ if (activeStep === SetupStep.Organization) {
+ await updateOrg({
+ orgId: currentOrg.id,
+ name: formData.organizationName,
+ slug: formData.organizationSlug
+ });
+ next();
+ return;
+ }
+
+ if (activeStep === SetupStep.Access) {
+ try {
+ await updateServerConfig({
+ allowSignUp: formData.signUpMode === SignUpMode.Anyone,
+ allowedSignUpDomain:
+ formData.signUpMode === SignUpMode.Anyone
+ ? formData.allowedSignUpDomain.trim() || null
+ : null,
+ ...((config.enabledLoginMethods !== null || dirtyFields.enabledLoginMethods) && {
+ enabledLoginMethods: formData.enabledLoginMethods
+ })
+ });
+ } catch (error) {
+ if (
+ axios.isAxiosError<{ error?: string }>(error) &&
+ error.response?.data?.error === SuperAdminErrorCode.AuthMethodLockout
+ ) {
+ setError("enabledLoginMethods", {
+ message: "Select at least one login method."
+ });
+ return;
+ }
+
+ throw error;
+ }
+
+ next();
+ return;
+ }
+
+ await complete();
+ });
+
+ const renderStep = () => {
+ if (activeStep === SetupStep.Account) {
+ return (
+ <FieldGroup>
+ <div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
+ <Field data-invalid={Boolean(errors.firstName)}>
+ <FieldLabel className="sr-only" htmlFor="setup-first-name">
+ First Name
+ </FieldLabel>
+ <Input
+ variant="outlined"
+ {...register("firstName")}
+ id="setup-first-name"
+ placeholder="First Name"
+ autoComplete="given-name"
+ autoFocus
+ isError={Boolean(errors.firstName)}
+ />
+ <FieldError>{errors.firstName?.message}</FieldError>
+ </Field>
+ <Field data-invalid={Boolean(errors.lastName)}>
+ <FieldLabel className="sr-only" htmlFor="setup-last-name">
+ Last Name
+ </FieldLabel>
+ <Input
+ variant="outlined"
+ {...register("lastName")}
+ id="setup-last-name"
+ placeholder="Last Name"
+ autoComplete="family-name"
+ isError={Boolean(errors.lastName)}
+ />
+ <FieldError>{errors.lastName?.message}</FieldError>
+ </Field>
+ </div>
+ <Field>
+ <FieldLabel className="sr-only" htmlFor="setup-email">
+ Email
+ </FieldLabel>
+ <Input
+ variant="outlined"
+ id="setup-email"
+ type="email"
+ value={user.email ?? user.username}
+ autoComplete="email"
+ disabled
+ />
+ <FieldDescription>
+ Email changes require verification and can be managed later in Personal Settings.
+ </FieldDescription>
+ </Field>
+ </FieldGroup>
+ );
+ }
+
+ if (activeStep === SetupStep.Organization) {
+ return (
+ <FieldGroup>
+ <Field data-invalid={Boolean(errors.organizationName)}>
+ <FieldLabel className="sr-only" htmlFor="setup-organization-name">
+ Organization name
+ </FieldLabel>
+ <Input
+ variant="outlined"
+ {...register("organizationName")}
+ id="setup-organization-name"
+ aria-label="Organization name"
+ placeholder="Organization name"
+ autoComplete="organization"
+ autoFocus
+ isError={Boolean(errors.organizationName)}
+ />
+ <FieldError>{errors.organizationName?.message}</FieldError>
+ </Field>
+ <Controller
+ control={control}
+ name="organizationSlug"
+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="setup-organization-slug">Organization slug</FieldLabel>
+ <Input
+ variant="outlined"
+ {...field}
+ id="setup-organization-slug"
+ aria-describedby="setup-organization-slug-feedback"
+ placeholder="acme"
+ autoComplete="off"
+ isError={Boolean(error)}
+ onChange={(event) => onChange(normalizeSlugInput(event.target.value))}
+ />
+ <FieldFeedback
+ id="setup-organization-slug-feedback"
+ description="Lowercase letters, numbers, and hyphens only. Spaces become hyphens."
+ error={error?.message}
+ />
+ </Field>
+ )}
+ />
+ </FieldGroup>
+ );
+ }
+
+ if (activeStep === SetupStep.Access) {
+ return (
+ <FieldGroup>
+ <Controller
+ control={control}
+ name="signUpMode"
+ render={({ field }) => (
+ <Field>
+ <h3 className="font-alliance text-base font-medium text-foreground">
+ Who can create accounts?
+ </h3>
+ <RadioGroup
+ value={field.value}
+ className="grid-cols-2"
+ onValueChange={field.onChange}
+ >
+ <FieldLabel htmlFor="signup-disabled">
+ <Field orientation="horizontal">
+ <FieldContent>
+ <FieldTitle className="font-alliance text-base">Invite-only</FieldTitle>
+ <FieldDescription>Recommended for most instances.</FieldDescription>
+ </FieldContent>
+ <RadioGroupItem value={SignUpMode.Disabled} id="signup-disabled" />
+ </Field>
+ </FieldLabel>
+ <FieldLabel htmlFor="signup-anyone">
+ <Field orientation="horizontal">
+ <FieldContent>
+ <FieldTitle className="gap-1 font-alliance text-base">
+ Anyone
+ <span aria-hidden="true" className="font-inter text-xs text-danger">
+ *
+ </span>
+ </FieldTitle>
+ <FieldDescription>Optionally limit by source/domain</FieldDescription>
+ </FieldContent>
+ <RadioGroupItem value={SignUpMode.Anyone} id="signup-anyone" />
+ </Field>
+ </FieldLabel>
+ </RadioGroup>
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="enabledLoginMethods"
+ render={({ field }) => (
+ <Field>
+ <div className="flex items-center gap-3">
+ <h3 className="shrink-0 font-alliance text-base font-medium text-foreground">
+ Allowed authentication methods
+ </h3>
+ <Separator className="flex-1" />
+ </div>
+ <div className="grid grid-cols-2 gap-2 sm:grid-cols-4">
+ {loginMethods.map((method) => {
+ const isChecked = field.value.includes(method.value);
+ const MethodIcon = method.icon;
+
+ return (
+ <FieldLabel
+ key={method.value}
+ htmlFor={`login-method-${method.value}`}
+ className={cn(
+ "h-full transition-opacity",
+ !isChecked && "border-transparent opacity-60 hover:opacity-80"
+ )}
+ >
+ <Field orientation="horizontal" className="h-full items-center gap-2">
+ <div className="flex size-4 shrink-0 items-center justify-center text-muted">
+ {method.imageSrc ? (
+ <img
+ src={method.imageSrc}
+ alt=""
+ aria-hidden="true"
+ className="size-4 object-contain"
+ />
+ ) : (
+ MethodIcon && <MethodIcon className="size-4" />
+ )}
+ </div>
+ <FieldTitle className="h-4 text-sm leading-none">
+ {method.label}
+ </FieldTitle>
+ <Checkbox
+ id={`login-method-${method.value}`}
+ aria-label={method.label}
+ variant="project"
+ isChecked={isChecked}
+ onCheckedChange={(checked) => {
+ clearErrors("enabledLoginMethods");
+ field.onChange(
+ checked
+ ? [...field.value, method.value]
+ : field.value.filter((value) => value !== method.value)
+ );
+ }}
+ />
+ </Field>
+ </FieldLabel>
+ );
+ })}
+ </div>
+ <FieldDescription>
+ SAML, LDAP, and OIDC can be configured after onboarding in the Server Console.
+ </FieldDescription>
+ <FieldError>{errors.enabledLoginMethods?.message}</FieldError>
+ </Field>
+ )}
+ />
+
+ <AnimatedCollapse
+ isOpen={values.signUpMode === SignUpMode.Anyone}
+ contentClassName="-m-2 p-2"
+ >
+ <Controller
+ control={control}
+ name="allowedSignUpDomain"
+ render={({ field, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="allowed-signup-domain" className="text-xs">
+ <span>
+ <span aria-hidden="true" className="mr-1 text-danger">
+ *
+ </span>
+ Limit allowed email domains{" "}
+ <span className="opacity-60">
+ (recommended, applies to all sign-up methods)
+ </span>
+ </span>
+ </FieldLabel>
+ <Input
+ variant="outlined"
+ {...field}
+ id="allowed-signup-domain"
+ aria-describedby="allowed-signup-domain-feedback"
+ isError={Boolean(error)}
+ placeholder="acme.com, example.com"
+ />
+ <FieldFeedback
+ id="allowed-signup-domain-feedback"
+ description="Leave blank to allow any email domain."
+ error={error?.message}
+ />
+ </Field>
+ )}
+ />
+ </AnimatedCollapse>
+ </FieldGroup>
+ );
+ }
+
+ const enabledMethodLabels = loginMethods
+ .filter(({ value }) => values.enabledLoginMethods.includes(value))
+ .map(({ label }) => label)
+ .join(", ");
+ const allowedDomains = formatAllowedDomains(values.allowedSignUpDomain);
+ let signUpSummary = "Anyone can sign up";
+ if (values.signUpMode === SignUpMode.Disabled) {
+ signUpSummary = "Invitation only";
+ } else if (allowedDomains) {
+ signUpSummary = `Signups limited to following domains: ${allowedDomains}`;
+ }
+ const reviewItems = [
+ {
+ step: SetupStep.Account,
+ title: "Super Admin account",
+ description: [
+ [values.firstName, values.lastName].filter(Boolean).join(" "),
+ user.email ?? user.username
+ ]
+ .filter(Boolean)
+ .join(" · ")
+ },
+ {
+ step: SetupStep.Organization,
+ title: "Initial organization",
+ description: `${values.organizationName} · ${values.organizationSlug}`
+ },
+ {
+ step: SetupStep.Access,
+ title: "User access",
+ description: signUpSummary
+ },
+ {
+ step: SetupStep.Access,
+ title: "Login methods",
+ description: enabledMethodLabels
+ }
+ ];
+
+ return (
+ <div className="overflow-hidden rounded-lg border border-border bg-card">
+ {reviewItems.map((item, index) => (
+ <button
+ key={item.title}
+ type="button"
+ className={cn(
+ "group grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-3 p-4 text-left transition-colors hover:bg-container-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
+ index < reviewItems.length - 1 && "border-b border-border"
+ )}
+ onClick={() => setActiveStep(item.step)}
+ >
+ <Check className="mt-0.5 size-4 text-success" />
+ <span>
+ <span className="block text-sm font-medium text-foreground">{item.title}</span>
+ <span className="block text-sm leading-relaxed text-muted">{item.description}</span>
+ </span>
+ <ChevronRight className="size-4 self-center text-muted transition-transform group-hover:translate-x-0.5 group-hover:text-foreground" />
+ </button>
+ ))}
+ </div>
+ );
+ };
+
+ return (
+ <OnboardingPageLayout
+ variant="focused"
+ currentStep={activeStepIndex + 1}
+ totalSteps={steps.length}
+ contentClassName="max-w-xl"
+ showFooter={false}
+ anchorBottomContent
+ bottomContent={
+ <div className="mx-auto flex w-full max-w-xl justify-between gap-3">
+ {activeStepIndex > 0 && (
+ <Button type="button" variant="outline" onClick={back}>
+ <ChevronLeft />
+ Back
+ </Button>
+ )}
+ <Button
+ type="submit"
+ form={setupFormId}
+ variant="project"
+ isPending={isSubmitting || isCompleting}
+ className={cn(activeStepIndex === 0 && "ml-auto")}
+ >
+ {activeStep === SetupStep.Review ? "Finish setup" : "Continue"}
+ </Button>
+ </div>
+ }
+ >
+ <Helmet>
+ <title>Configure your instance | Infisical</title>
+ <link rel="icon" href="/infisical.ico" />
+ </Helmet>
+ <AuthPagePanel>
+ <form id={setupFormId} onSubmit={onSubmit}>
+ <CardHeader className="mb-8 gap-2">
+ <CardTitle className="font-alliance text-3xl leading-tight font-normal">
+ {stepContent[activeStep].title}
+ </CardTitle>
+ <CardDescription className="font-alliance text-base leading-relaxed">
+ {stepContent[activeStep].description}
+ </CardDescription>
+ </CardHeader>
+
+ <CardContent>{renderStep()}</CardContent>
+ </form>
+ </AuthPagePanel>
+ </OnboardingPageLayout>
+ );
+};
diff --git a/frontend/src/pages/admin/SetupPage/route.tsx b/frontend/src/pages/admin/SetupPage/route.tsx
new file mode 100644
index 0000000000..cbbcbc4906
--- /dev/null
+++ b/frontend/src/pages/admin/SetupPage/route.tsx
@@ -0,0 +1,15 @@
+import { createFileRoute, redirect } from "@tanstack/react-router";
+
+import { SetupPage } from "./SetupPage";
+
+export const Route = createFileRoute("/_authenticate/_inject-org-details/admin/setup")({
+ component: SetupPage,
+ beforeLoad: ({ context }) => {
+ if (!context.user.superAdmin) {
+ throw redirect({
+ to: "/organizations/$orgId/projects",
+ params: { orgId: context.organizationId }
+ });
+ }
+ }
+});
diff --git a/frontend/src/pages/admin/SignUpPage/SignUpPage.tsx b/frontend/src/pages/admin/SignUpPage/SignUpPage.tsx
index 0d8a9eb722..441fc8886d 100644
--- a/frontend/src/pages/admin/SignUpPage/SignUpPage.tsx
+++ b/frontend/src/pages/admin/SignUpPage/SignUpPage.tsx
@@ -1,49 +1,168 @@
+import { useState } from "react";
import { Helmet } from "react-helmet";
-import { useTranslation } from "react-i18next";
-import { useNavigate } from "@tanstack/react-router";
+import { useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { useNavigate, useRouter } from "@tanstack/react-router";
+import axios from "axios";
+import { ChevronLeft } from "lucide-react";
+import { z } from "zod";
-import { AuthPageLayout } from "@app/components/auth/AuthPageLayout";
import { AuthPagePanel } from "@app/components/auth/AuthPagePanel";
+import { OnboardingPageLayout } from "@app/components/auth/OnboardingPageLayout";
import SecurityClient from "@app/components/utilities/SecurityClient";
-import { CardContent, CardDescription, CardHeader, CardTitle } from "@app/components/v3";
-import { useSelectOrganization } from "@app/hooks/api";
+import {
+ Alert,
+ AlertDescription,
+ Button,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldError,
+ Input
+} from "@app/components/v3";
+import { useCreateAdminUser, useSelectOrganization } from "@app/hooks/api";
+import { GenericResourceNameSchema } from "@app/lib/schemas";
import { AdminSignUpForm } from "./components/AdminSignUpForm";
+import { AdminSignUpFormData } from "./adminSignUpSchema";
+
+enum BootstrapStep {
+ Account,
+ Organization
+}
+
+const organizationSchema = z.object({
+ organizationName: GenericResourceNameSchema
+});
+
+type TOrganizationForm = z.infer<typeof organizationSchema>;
+
+const stepContent = {
+ [BootstrapStep.Account]: {
+ title: "Create your Super Admin account",
+ description: "Use this account to manage your Infisical instance."
+ },
+ [BootstrapStep.Organization]: {
+ title: "Create your organization",
+ description: "Set up the first workspace for your projects, secrets, and team."
+ }
+} satisfies Record<BootstrapStep, { title: string; description: string }>;
export const SignUpPage = () => {
- const { t } = useTranslation();
const navigate = useNavigate();
+ const router = useRouter();
+ const [activeStep, setActiveStep] = useState(BootstrapStep.Account);
+ const [accountData, setAccountData] = useState<AdminSignUpFormData>();
+ const [formError, setFormError] = useState<string>();
+ const { mutateAsync: createAdminUser, isPending } = useCreateAdminUser();
const { mutateAsync: selectOrganization } = useSelectOrganization();
+ const {
+ formState: { errors },
+ handleSubmit,
+ register
+ } = useForm<TOrganizationForm>({
+ resolver: zodResolver(organizationSchema),
+ defaultValues: {
+ organizationName: ""
+ }
+ });
- const handleSuccess = async (result: { token: string; organization: { id: string } }) => {
- SecurityClient.setToken(result.token);
- await selectOrganization({ organizationId: result.organization.id });
- localStorage.setItem("orgData.id", result.organization.id);
- navigate({ to: "/admin" });
+ const handleAccountContinue = (values: AdminSignUpFormData) => {
+ setAccountData(values);
+ setFormError(undefined);
+ setActiveStep(BootstrapStep.Organization);
};
+ const handleOrganizationSubmit = handleSubmit(async ({ organizationName }) => {
+ if (!accountData) {
+ setActiveStep(BootstrapStep.Account);
+ return;
+ }
+
+ setFormError(undefined);
+
+ try {
+ const result = await createAdminUser({
+ email: accountData.email,
+ password: accountData.password,
+ firstName: accountData.firstName,
+ lastName: accountData.lastName || undefined,
+ organizationName
+ });
+
+ SecurityClient.setToken(result.token);
+ await selectOrganization({ organizationId: result.organization.id });
+ localStorage.setItem("orgData.id", result.organization.id);
+ await router.invalidate();
+ await navigate({ to: "/admin/setup" });
+ } catch (error) {
+ const message = axios.isAxiosError<{ message?: string }>(error)
+ ? error.response?.data?.message
+ : undefined;
+ setFormError(message || "Unable to create the instance. Please try again.");
+ }
+ });
+
return (
- <AuthPageLayout variant="focused">
+ <OnboardingPageLayout currentStep={activeStep + 1} totalSteps={4}>
<Helmet>
- <title>{t("common.head-title", { title: t("signup.title") })}</title>
+ <title>Set up your instance | Infisical</title>
<link rel="icon" href="/infisical.ico" />
<meta property="og:image" content="/images/message.png" />
- <meta property="og:title" content={t("signup.og-title") ?? ""} />
- <meta name="og:description" content={t("signup.og-description") ?? ""} />
</Helmet>
<AuthPagePanel>
<CardHeader className="mb-6 gap-2">
<CardTitle className="font-alliance text-2xl font-normal">
- Set up your Infisical instance
+ {stepContent[activeStep].title}
</CardTitle>
<CardDescription className="font-alliance text-base">
- Create a local Super Admin account
+ {stepContent[activeStep].description}
</CardDescription>
</CardHeader>
<CardContent>
- <AdminSignUpForm onSuccess={handleSuccess} />
+ {activeStep === BootstrapStep.Account ? (
+ <AdminSignUpForm defaultValues={accountData} onContinue={handleAccountContinue} />
+ ) : (
+ <form className="flex flex-col gap-6" noValidate onSubmit={handleOrganizationSubmit}>
+ {formError && (
+ <Alert variant="danger">
+ <AlertDescription>{formError}</AlertDescription>
+ </Alert>
+ )}
+ <Field data-invalid={Boolean(errors.organizationName)}>
+ <Input
+ variant="outlined"
+ {...register("organizationName")}
+ id="admin-signup-organization"
+ aria-label="Organization name"
+ placeholder="Organization name"
+ autoComplete="organization"
+ autoFocus
+ isError={Boolean(errors.organizationName)}
+ />
+ {errors.organizationName ? (
+ <FieldError>{errors.organizationName.message}</FieldError>
+ ) : null}
+ </Field>
+ <div className="flex justify-between gap-3">
+ <Button
+ type="button"
+ variant="outline"
+ onClick={() => setActiveStep(BootstrapStep.Account)}
+ >
+ <ChevronLeft />
+ Back
+ </Button>
+ <Button type="submit" variant="project" isPending={isPending}>
+ Create organization
+ </Button>
+ </div>
+ </form>
+ )}
</CardContent>
</AuthPagePanel>
- </AuthPageLayout>
+ </OnboardingPageLayout>
);
};
diff --git a/frontend/src/pages/admin/SignUpPage/components/AdminSignUpForm.tsx b/frontend/src/pages/admin/SignUpPage/components/AdminSignUpForm.tsx
index e502dd72bb..fc18b8b8d9 100644
--- a/frontend/src/pages/admin/SignUpPage/components/AdminSignUpForm.tsx
+++ b/frontend/src/pages/admin/SignUpPage/components/AdminSignUpForm.tsx
@@ -1,14 +1,11 @@
import { useState } from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
-import axios from "axios";
import { Check, Eye, EyeOff, X } from "lucide-react";
import { PasswordField } from "@app/components/auth/PasswordField";
import { usePasswordBreachCheck } from "@app/components/utilities/checks/password/usePasswordBreachCheck";
import {
- Alert,
- AlertDescription,
AnimatedCollapse,
Button,
Field,
@@ -22,24 +19,17 @@ import {
InputGroupInput
} from "@app/components/v3";
import { useServerConfig } from "@app/context";
-import { useCreateAdminUser } from "@app/hooks/api";
import { AdminSignUpFormData, createAdminSignUpSchema } from "../adminSignUpSchema";
-type AdminSignUpResult = {
- token: string;
- organization: { id: string };
-};
-
type AdminSignUpFormProps = {
- onSuccess: (result: AdminSignUpResult) => Promise<void>;
+ defaultValues?: AdminSignUpFormData;
+ onContinue: (values: AdminSignUpFormData) => void;
};
-export const AdminSignUpForm = ({ onSuccess }: AdminSignUpFormProps) => {
- const [formError, setFormError] = useState<string>();
+export const AdminSignUpForm = ({ defaultValues, onContinue }: AdminSignUpFormProps) => {
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
const { config } = useServerConfig();
- const { mutateAsync: createAdminUser } = useCreateAdminUser();
const {
formState: { errors, isSubmitting, submitCount },
handleSubmit,
@@ -50,7 +40,7 @@ export const AdminSignUpForm = ({ onSuccess }: AdminSignUpFormProps) => {
resolver: zodResolver(createAdminSignUpSchema(config.passwordPolicy)),
mode: "onChange",
reValidateMode: "onChange",
- defaultValues: {
+ defaultValues: defaultValues ?? {
firstName: "",
lastName: "",
email: "",
@@ -66,8 +56,7 @@ export const AdminSignUpForm = ({ onSuccess }: AdminSignUpFormProps) => {
});
const confirmPassword = watch("confirmPassword");
- const onSubmit = async ({ confirmPassword: _, ...values }: AdminSignUpFormData) => {
- setFormError(undefined);
+ const onSubmit = async (values: AdminSignUpFormData) => {
const latestBreachStatus = await validatePassword(values.password);
if (latestBreachStatus === "breached") {
@@ -78,18 +67,7 @@ export const AdminSignUpForm = ({ onSuccess }: AdminSignUpFormProps) => {
return;
}
- try {
- const result = await createAdminUser({
- ...values,
- lastName: values.lastName || undefined
- });
- await onSuccess(result);
- } catch (error) {
- const message = axios.isAxiosError<{ message?: string }>(error)
- ? error.response?.data?.message
- : undefined;
- setFormError(message || "Unable to create the administrator account. Please try again.");
- }
+ onContinue(values);
};
const showDangerState = submitCount > 0;
@@ -100,11 +78,6 @@ export const AdminSignUpForm = ({ onSuccess }: AdminSignUpFormProps) => {
return (
<form className="flex flex-col gap-4" noValidate onSubmit={handleSubmit(onSubmit)}>
- {formError && (
- <Alert variant="danger">
- <AlertDescription>{formError}</AlertDescription>
- </Alert>
- )}
<FieldGroup>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
<Field data-invalid={showDangerState && Boolean(errors.firstName)}>
@@ -220,7 +193,7 @@ export const AdminSignUpForm = ({ onSuccess }: AdminSignUpFormProps) => {
isPending={isSubmitting}
isDisabled={!canSubmit}
>
- Create Super Admin
+ Continue
</Button>
</form>
);
diff --git a/frontend/src/pages/admin/WelcomePage/WelcomePage.tsx b/frontend/src/pages/admin/WelcomePage/WelcomePage.tsx
new file mode 100644
index 0000000000..e0cdfcd440
--- /dev/null
+++ b/frontend/src/pages/admin/WelcomePage/WelcomePage.tsx
@@ -0,0 +1,89 @@
+import { Helmet } from "react-helmet";
+import { useNavigate } from "@tanstack/react-router";
+import { ArrowRight, Building2, KeyRound, ServerCog } from "lucide-react";
+
+import { AuthPageLayout } from "@app/components/auth/AuthPageLayout";
+import { AuthPagePanel } from "@app/components/auth/AuthPagePanel";
+import { CardContent, CardDescription, CardHeader, CardTitle } from "@app/components/v3";
+
+type Props = {
+ organizationId: string;
+};
+
+export const WelcomePage = ({ organizationId }: Props) => {
+ const navigate = useNavigate();
+
+ return (
+ <AuthPageLayout variant="focused" contentClassName="max-w-xl">
+ <Helmet>
+ <title>Instance ready | Infisical</title>
+ <link rel="icon" href="/infisical.ico" />
+ </Helmet>
+ <AuthPagePanel>
+ <CardHeader className="gap-0">
+ <div className="relative mb-8 flex size-10 items-center justify-center bg-primary text-black">
+ <KeyRound className="size-5" />
+ <span aria-hidden="true" className="absolute -top-1.5 -right-1.5 size-2 bg-primary" />
+ </div>
+ <CardTitle className="font-alliance text-3xl leading-tight font-normal">
+ Your instance is ready.
+ </CardTitle>
+ <CardDescription className="mt-2 max-w-lg font-alliance text-base leading-relaxed">
+ Choose where you want to go next:
+ </CardDescription>
+ </CardHeader>
+
+ <CardContent className="mt-8 space-y-8">
+ <div className="grid gap-3">
+ <button
+ type="button"
+ className="group grid min-h-18 cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center rounded-md border border-primary/30 bg-primary/25 p-4 text-left text-foreground transition-all select-none hover:border-primary/35 hover:bg-primary/30 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-0 active:scale-[0.99] disabled:pointer-events-none disabled:opacity-50"
+ onClick={() =>
+ navigate({
+ to: "/organizations/$orgId/projects",
+ params: { orgId: organizationId }
+ })
+ }
+ >
+ <span className="flex min-w-0 flex-col gap-1">
+ <span className="flex items-start gap-2">
+ <Building2 className="size-5 text-foreground" />
+ <span className="font-alliance text-base font-medium text-foreground">
+ Go to dashboard
+ </span>
+ </span>
+ <span className="block text-sm leading-relaxed text-foreground/70">
+ Create projects, manage secrets, and invite your team.
+ </span>
+ </span>
+ <ArrowRight className="size-4 text-foreground/70 transition-transform group-hover:translate-x-0.5 group-hover:text-foreground" />
+ </button>
+
+ <button
+ type="button"
+ className="group grid min-h-18 grid-cols-[minmax(0,1fr)_auto] items-center rounded-lg border border-border bg-card p-4 text-left transition-colors hover:border-foreground/20 hover:bg-foreground/5 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-wait disabled:opacity-60"
+ onClick={() => navigate({ to: "/admin" })}
+ >
+ <span className="flex min-w-0 flex-col gap-1">
+ <span className="flex items-start gap-2">
+ <ServerCog className="size-5 text-foreground" />
+ <span className="font-alliance text-base font-medium text-foreground">
+ Access server console
+ </span>
+ </span>
+ <span className="block text-sm leading-relaxed text-label">
+ Make fine-grained adjustments to the instance configuration.
+ </span>
+ </span>
+ <ArrowRight className="size-4 text-label transition-transform group-hover:translate-x-0.5 group-hover:text-foreground" />
+ </button>
+ </div>
+
+ <p className="border-t border-border pt-6 text-xs leading-relaxed text-label">
+ You can always access the Server Console later from the app navigation header.
+ </p>
+ </CardContent>
+ </AuthPagePanel>
+ </AuthPageLayout>
+ );
+};
diff --git a/frontend/src/pages/admin/WelcomePage/route.tsx b/frontend/src/pages/admin/WelcomePage/route.tsx
new file mode 100644
index 0000000000..83ea26e900
--- /dev/null
+++ b/frontend/src/pages/admin/WelcomePage/route.tsx
@@ -0,0 +1,23 @@
+import { createFileRoute, redirect, useRouteContext } from "@tanstack/react-router";
+
+import { WelcomePage } from "./WelcomePage";
+
+const WelcomeRoute = () => {
+ const { organizationId } = useRouteContext({
+ from: "/_authenticate/_inject-org-details/admin/welcome"
+ });
+
+ return <WelcomePage organizationId={organizationId} />;
+};
+
+export const Route = createFileRoute("/_authenticate/_inject-org-details/admin/welcome")({
+ component: WelcomeRoute,
+ beforeLoad: ({ context }) => {
+ if (!context.user.superAdmin) {
+ throw redirect({
+ to: "/organizations/$orgId/projects",
+ params: { orgId: context.organizationId }
+ });
+ }
+ }
+});
diff --git a/frontend/src/pages/admin/components/AdminV3Adapters.tsx b/frontend/src/pages/admin/components/AdminV3Adapters.tsx
index 794f9865c7..524f3ed024 100644
--- a/frontend/src/pages/admin/components/AdminV3Adapters.tsx
+++ b/frontend/src/pages/admin/components/AdminV3Adapters.tsx
@@ -30,6 +30,10 @@ import {
DropdownMenuItem as V3DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuTrigger,
+ Field,
+ FieldDescription,
+ FieldError,
+ FieldLabel,
IconButton as V3IconButton,
InputGroup,
InputGroupAddon,
@@ -375,4 +379,27 @@ export const ModalContent = ({
</DialogContent>
);
+export const FormControl = ({
+ label,
+ errorText,
+ tooltipText,
+ className,
+ isError,
+ children
+}: {
+ label?: ReactNode;
+ errorText?: ReactNode;
+ tooltipText?: ReactNode;
+ className?: string;
+ isError?: boolean;
+ children: ReactNode;
+}) => (
+ <Field className={className} data-invalid={isError}>
+ {label && <FieldLabel>{label}</FieldLabel>}
+ {children}
+ {tooltipText && <FieldDescription>{tooltipText}</FieldDescription>}
+ {errorText && <FieldError>{errorText}</FieldError>}
+ </Field>
+);
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuTrigger };
diff --git a/frontend/src/pages/middlewares/authenticate.tsx b/frontend/src/pages/middlewares/authenticate.tsx
index cb77c93654..06972c8cda 100644
--- a/frontend/src/pages/middlewares/authenticate.tsx
+++ b/frontend/src/pages/middlewares/authenticate.tsx
@@ -78,6 +78,12 @@ export const Route = createFileRoute("/_authenticate")({
});
});
+ const isOnAdminSetup = location.pathname === "/admin/setup";
+
+ if (user.superAdmin && context.serverConfig.onboardingCompleted === false && !isOnAdminSetup) {
+ throw redirect({ to: "/admin/setup" });
+ }
+
const isSubOrganization = !!data.subOrganizationId;
return {
organizationId: isSubOrganization ? data.subOrganizationId : (data.organizationId as string),
diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.ts
index 3c068b66b2..419b6f380e 100644
--- a/frontend/src/routeTree.gen.ts
+++ b/frontend/src/routeTree.gen.ts
@@ -46,6 +46,8 @@ import { Route as authLoginPageRouteImport } from './pages/auth/LoginPage/route'
import { Route as redirectsPamAccessRedirectImport } from './pages/redirects/pam-access-redirect'
import { Route as adminLayoutImport } from './pages/admin/layout'
import { Route as authProviderErrorPageRouteImport } from './pages/auth/ProviderErrorPage/route'
+import { Route as adminWelcomePageRouteImport } from './pages/admin/WelcomePage/route'
+import { Route as adminSetupPageRouteImport } from './pages/admin/SetupPage/route'
import { Route as userPersonalSettingsPageRouteImport } from './pages/user/PersonalSettingsPage/route'
import { Route as adminIntegrationsPageRouteImport } from './pages/admin/IntegrationsPage/route'
import { Route as adminEnvironmentPageRouteImport } from './pages/admin/EnvironmentPage/route'
@@ -670,6 +672,18 @@ const authProviderErrorPageRouteRoute = authProviderErrorPageRouteImport.update(
} as any,
)
+const adminWelcomePageRouteRoute = adminWelcomePageRouteImport.update({
+ id: '/welcome',
+ path: '/welcome',
+ getParentRoute: () => AuthenticateInjectOrgDetailsAdminRoute,
+} as any)
+
+const adminSetupPageRouteRoute = adminSetupPageRouteImport.update({
+ id: '/setup',
+ path: '/setup',
+ getParentRoute: () => AuthenticateInjectOrgDetailsAdminRoute,
+} as any)
+
const userPersonalSettingsPageRouteRoute =
userPersonalSettingsPageRouteImport.update({
id: '/',
@@ -2992,6 +3006,20 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof userPersonalSettingsPageRouteImport
parentRoute: typeof userLayoutImport
}
+ '/_authenticate/_inject-org-details/admin/setup': {
+ id: '/_authenticate/_inject-org-details/admin/setup'
+ path: '/setup'
+ fullPath: '/admin/setup'
+ preLoaderRoute: typeof adminSetupPageRouteImport
+ parentRoute: typeof AuthenticateInjectOrgDetailsAdminImport
+ }
+ '/_authenticate/_inject-org-details/admin/welcome': {
+ id: '/_authenticate/_inject-org-details/admin/welcome'
+ path: '/welcome'
+ fullPath: '/admin/welcome'
+ preLoaderRoute: typeof adminWelcomePageRouteImport
+ parentRoute: typeof AuthenticateInjectOrgDetailsAdminImport
+ }
'/_restrict-login-signup/login/provider/error': {
id: '/_restrict-login-signup/login/provider/error'
path: '/provider/error'
@@ -6104,11 +6132,15 @@ const adminLayoutRouteWithChildren = adminLayoutRoute._addFileChildren(
)
interface AuthenticateInjectOrgDetailsAdminRouteChildren {
+ adminSetupPageRouteRoute: typeof adminSetupPageRouteRoute
+ adminWelcomePageRouteRoute: typeof adminWelcomePageRouteRoute
adminLayoutRoute: typeof adminLayoutRouteWithChildren
}
const AuthenticateInjectOrgDetailsAdminRouteChildren: AuthenticateInjectOrgDetailsAdminRouteChildren =
{
+ adminSetupPageRouteRoute: adminSetupPageRouteRoute,
+ adminWelcomePageRouteRoute: adminWelcomePageRouteRoute,
adminLayoutRoute: adminLayoutRouteWithChildren,
}
@@ -6309,6 +6341,8 @@ export interface FileRoutesByFullPath {
'/shared/secret/$secretId': typeof publicViewSharedSecretByIDPageRouteRoute
'/admin': typeof adminLayoutRouteWithChildren
'/personal-settings/': typeof userPersonalSettingsPageRouteRoute
+ '/admin/setup': typeof adminSetupPageRouteRoute
+ '/admin/welcome': typeof adminWelcomePageRouteRoute
'/login/provider/error': typeof authProviderErrorPageRouteRoute
'/integrations': typeof AuthenticateInjectOrgDetailsOrgLayoutIntegrationsRouteWithChildren
'/pam/access': typeof redirectsPamAccessRedirectRoute
@@ -6605,6 +6639,8 @@ export interface FileRoutesByTo {
'/secret-request/secret/$secretRequestId': typeof publicViewSecretRequestByIDPageRouteRoute
'/shared/secret/$secretId': typeof publicViewSharedSecretByIDPageRouteRoute
'/admin': typeof adminGeneralPageRouteRoute
+ '/admin/setup': typeof adminSetupPageRouteRoute
+ '/admin/welcome': typeof adminWelcomePageRouteRoute
'/login/provider/error': typeof authProviderErrorPageRouteRoute
'/integrations': typeof AuthenticateInjectOrgDetailsOrgLayoutIntegrationsRouteWithChildren
'/pam/access': typeof redirectsPamAccessRedirectRoute
@@ -6887,6 +6923,8 @@ export interface FileRoutesById {
'/_authenticate/_inject-org-details/admin': typeof AuthenticateInjectOrgDetailsAdminRouteWithChildren
'/_authenticate/personal-settings/_layout': typeof userLayoutRouteWithChildren
'/_authenticate/personal-settings/_layout/': typeof userPersonalSettingsPageRouteRoute
+ '/_authenticate/_inject-org-details/admin/setup': typeof adminSetupPageRouteRoute
+ '/_authenticate/_inject-org-details/admin/welcome': typeof adminWelcomePageRouteRoute
'/_restrict-login-signup/login/provider/error': typeof authProviderErrorPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/integrations': typeof AuthenticateInjectOrgDetailsOrgLayoutIntegrationsRouteWithChildren
'/_authenticate/_inject-org-details/admin/_admin-layout': typeof adminLayoutRouteWithChildren
@@ -7196,6 +7234,8 @@ export interface FileRouteTypes {
| '/shared/secret/$secretId'
| '/admin'
| '/personal-settings/'
+ | '/admin/setup'
+ | '/admin/welcome'
| '/login/provider/error'
| '/integrations'
| '/pam/access'
@@ -7491,6 +7531,8 @@ export interface FileRouteTypes {
| '/secret-request/secret/$secretRequestId'
| '/shared/secret/$secretId'
| '/admin'
+ | '/admin/setup'
+ | '/admin/welcome'
| '/login/provider/error'
| '/integrations'
| '/pam/access'
@@ -7771,6 +7813,8 @@ export interface FileRouteTypes {
| '/_authenticate/_inject-org-details/admin'
| '/_authenticate/personal-settings/_layout'
| '/_authenticate/personal-settings/_layout/'
+ | '/_authenticate/_inject-org-details/admin/setup'
+ | '/_authenticate/_inject-org-details/admin/welcome'
| '/_restrict-login-signup/login/provider/error'
| '/_authenticate/_inject-org-details/_org-layout/integrations'
| '/_authenticate/_inject-org-details/admin/_admin-layout'
@@ -8263,6 +8307,8 @@ export const routeTree = rootRoute
"filePath": "",
"parent": "/_authenticate/_inject-org-details",
"children": [
+ "/_authenticate/_inject-org-details/admin/setup",
+ "/_authenticate/_inject-org-details/admin/welcome",
"/_authenticate/_inject-org-details/admin/_admin-layout"
]
},
@@ -8277,6 +8323,14 @@ export const routeTree = rootRoute
"filePath": "user/PersonalSettingsPage/route.tsx",
"parent": "/_authenticate/personal-settings/_layout"
},
+ "/_authenticate/_inject-org-details/admin/setup": {
+ "filePath": "admin/SetupPage/route.tsx",
+ "parent": "/_authenticate/_inject-org-details/admin"
+ },
+ "/_authenticate/_inject-org-details/admin/welcome": {
+ "filePath": "admin/WelcomePage/route.tsx",
+ "parent": "/_authenticate/_inject-org-details/admin"
+ },
"/_restrict-login-signup/login/provider/error": {
"filePath": "auth/ProviderErrorPage/route.tsx",
"parent": "/_restrict-login-signup/login"
diff --git a/frontend/src/routes.ts b/frontend/src/routes.ts
index 26f588a8ca..59627290a9 100644
--- a/frontend/src/routes.ts
+++ b/frontend/src/routes.ts
@@ -4,6 +4,8 @@ const middleware = (fileName: string, virtualRoutes: VirtualRouteNode[]) =>
layout(`middlewares/${fileName}`, virtualRoutes);
const adminRoute = route("/admin", [
+ route("/welcome", "admin/WelcomePage/route.tsx"),
+ route("/setup", "admin/SetupPage/route.tsx"),
layout("admin-layout", "admin/layout.tsx", [
index("admin/GeneralPage/route.tsx"),
route("/encryption", "admin/EncryptionPage/route.tsx"),