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",