From c8bb656425fd1ce277fdd016b8a1281418def5f7 Mon Sep 17 00:00:00 2001 From: Madison Date: Fri, 23 May 2025 11:40:57 -0500 Subject: [PATCH 1/4] [Docs] - Fix: Correct OTP verification code description order (#696) ---- > [!IMPORTANT] > Corrects OTP code description order in `signInVerificationCodeHandler` in `verification-code-handler.tsx`. > > - **Docs**: > - Corrects `codeDescription` in `signInVerificationCodeHandler` in `verification-code-handler.tsx` to specify that the OTP is formed by concatenating the 6-digit code with the nonce, not the other way around. > > This description was created by [Ellipsis](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral) for c8ab4ef3ed823f2efcdaf36950b8a0b463750c7b. You can [customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this summary. It will automatically update as commits are pushed. Co-authored-by: Konsti Wohlwend --- .../api/latest/auth/otp/sign-in/verification-code-handler.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/backend/src/app/api/latest/auth/otp/sign-in/verification-code-handler.tsx b/apps/backend/src/app/api/latest/auth/otp/sign-in/verification-code-handler.tsx index 838ef2b7c..c95ebf734 100644 --- a/apps/backend/src/app/api/latest/auth/otp/sign-in/verification-code-handler.tsx +++ b/apps/backend/src/app/api/latest/auth/otp/sign-in/verification-code-handler.tsx @@ -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({}), From b15fea3ac9d1542ca86e744c1aaa69135edec4ee Mon Sep 17 00:00:00 2001 From: Zai Shi Date: Fri, 23 May 2025 18:41:33 +0200 Subject: [PATCH 2/4] Domain should be always defined in neon domain crud endpoint (#683) ---- > [!IMPORTANT] > Ensure `domain` is always defined in neon domain CRUD operations and add test for missing domain case. > > - **Schema Changes**: > - Update `domainReadSchema` and `domainCreateSchema` in `crud.tsx` to ensure `domain` is always defined. > - **Tests**: > - Add test case in `domain.test.ts` to verify failure when `domain` is not specified in the request body. > > This description was created by [Ellipsis](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral) for defea9d0ddf1e2c8b0c998bbbc37e3f433666384. You can [customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this summary. It will automatically update as commits are pushed. --------- Co-authored-by: Konsti Wohlwend --- .../latest/integrations/neon/domains/crud.tsx | 4 +- .../api/v1/integrations/neon/domain.test.ts | 37 +++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/app/api/latest/integrations/neon/domains/crud.tsx b/apps/backend/src/app/api/latest/integrations/neon/domains/crud.tsx index 552cb4d50..4a1235ef3 100644 --- a/apps/backend/src/app/api/latest/integrations/neon/domains/crud.tsx +++ b/apps/backend/src/app/api/latest/integrations/neon/domains/crud.tsx @@ -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(); diff --git a/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.ts b/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.ts index 1c5c39afc..0c2afb6ae 100644 --- a/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.ts +++ b/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.ts @@ -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", +