From 6f64000afb9208e7d3afb9d1779879160f8d8adf Mon Sep 17 00:00:00 2001 From: Juan P Lopez Date: Mon, 21 Oct 2024 14:12:50 -0500 Subject: [PATCH] fix: ci validation --- .../consent/app/login/phone/server-actions.ts | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/consent/app/login/phone/server-actions.ts b/apps/consent/app/login/phone/server-actions.ts index 0cc08c1d4f..b4ec56ed5b 100644 --- a/apps/consent/app/login/phone/server-actions.ts +++ b/apps/consent/app/login/phone/server-actions.ts @@ -75,6 +75,22 @@ export const getCaptchaChallenge = async ( } } + if (env.CI || env.NODE_ENV === "development") { + const params = new URLSearchParams({ + login_challenge, + }) + cookies().set( + createHash("md5").update(login_challenge).digest("hex"), + JSON.stringify({ + loginType: LoginType.phone, + value: phone, + remember: remember, + }), + { secure: true }, + ) + redirect(`/login/verification?${params}`) + } + let res: { id: string challengeCode: string @@ -96,22 +112,6 @@ export const getCaptchaChallenge = async ( const id = res.id const challenge = res.challengeCode - if (env.CI || env.NODE_ENV === "development") { - const params = new URLSearchParams({ - login_challenge, - }) - cookies().set( - createHash("md5").update(login_challenge).digest("hex"), - JSON.stringify({ - loginType: LoginType.phone, - value: phone, - remember: remember, - }), - { secure: true }, - ) - redirect(`/login/verification?${params}`) - } - return { error: false, message: "success",