Skip to content

Commit

Permalink
fix: ci validation
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi committed Oct 21, 2024
1 parent 1514dd2 commit 6f64000
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions apps/consent/app/login/phone/server-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down

0 comments on commit 6f64000

Please sign in to comment.