Merge branch 'dev' into general-provision

This commit is contained in:
Zai Shi 2025-05-23 12:17:06 -07:00
commit f39832e083
7 changed files with 822 additions and 789 deletions

View File

@ -75,7 +75,7 @@ export const signInVerificationCodeHandler = createVerificationCodeHandler({
description: "Check if a sign in code is valid without using it",
tags: ["OTP"],
},
codeDescription: `A 45-character verification code. For magic links, this is the code found in the "code" URL query parameter. For OTP, this is formed by concatenating the nonce (received during code creation) with the 6-digit code entered by the user`,
codeDescription: `A 45-character verification code. For magic links, this is the code found in the "code" URL query parameter. For OTP, this is formed by concatenating the 6-digit code entered by the user with the nonce (received during code creation)`,
},
type: VerificationCodeType.ONE_TIME_PASSWORD,
data: yupObject({}),

View File

@ -11,11 +11,11 @@ const domainSchema = schemaFields.urlSchema.defined()
.meta({ openapiField: { description: 'URL. Must start with http:// or https://', exampleValue: 'https://example.com' } });
const domainReadSchema = yupObject({
domain: domainSchema,
domain: domainSchema.defined(),
});
const domainCreateSchema = yupObject({
domain: domainSchema,
domain: domainSchema.defined(),
});
export const domainDeleteSchema = yupMixed();

View File

@ -154,7 +154,7 @@ export async function createOrUpdateProject(
'teams.allowClientTeamCreation': dataOptions.client_team_creation_enabled,
'teams.createPersonalTeamOnSignUp': dataOptions.create_team_on_sign_up,
// ======================= domains =======================
'domains.allowLocalhost': dataOptions.allow_localhost,
'domains.allowLocalhost': dataOptions.allow_localhost ?? true,
'domains.trustedDomains': dataOptions.domains ? dataOptions.domains.map((domain) => {
return {
baseUrl: domain.domain,

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 597 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 591 B

View File

@ -159,3 +159,40 @@ it("adds two domains and deletes one", async ({ expect }) => {
}
`);
});
it("fails when not specifying a domain", async ({ expect }) => {
await Auth.Otp.signIn();
const { adminAccessToken } = await Project.createAndGetAdminToken();
const response = await niceBackendFetch("/api/v1/integrations/neon/domains", {
accessType: "admin",
headers: {
'x-stack-admin-access-token': adminAccessToken,
},
method: "POST",
body: {},
});
expect(response).toMatchInlineSnapshot(`
NiceResponse {
"status": 400,
"body": {
"code": "SCHEMA_ERROR",
"details": {
"message": deindent\`
Request validation failed on POST /api/v1/integrations/neon/domains:
- body.domain must be defined
\`,
},
"error": deindent\`
Request validation failed on POST /api/v1/integrations/neon/domains:
- body.domain must be defined
\`,
},
"headers": Headers {
"x-stack-known-error": "SCHEMA_ERROR",
<some fields may have been hidden>,
},
}
`);
});

File diff suppressed because it is too large Load Diff