Skip to content

Commit

Permalink
fix: allow test numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi committed Feb 5, 2025
1 parent 8439e0a commit bf7871e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/api/src/app/authentication/request-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ export const requestPhoneCodeWithCaptcha = async ({
if (limitOk instanceof Error) return limitOk
}

const checkedChannel = checkedToChannel(phone, channel)
if (checkedChannel instanceof Error) return checkedChannel

if (UNSECURE_DEFAULT_LOGIN_CODE) {
return true
}
Expand All @@ -71,6 +68,9 @@ export const requestPhoneCodeWithCaptcha = async ({
const user = await UsersRepository().findByPhone(phone)
const phoneExists = !(user instanceof Error)

const checkedChannel = checkedToChannel(phone, channel)
if (checkedChannel instanceof Error) return checkedChannel

return TwilioClient().initiateVerify({
to: phone,
channel: checkedChannel,
Expand Down Expand Up @@ -103,9 +103,6 @@ export const requestPhoneCodeForAuthedUser = async ({
return new PhoneAlreadyExistsError()
}

const checkedChannel = checkedToChannel(phone, channel)
if (checkedChannel instanceof Error) return checkedChannel

if (UNSECURE_DEFAULT_LOGIN_CODE) {
return true
}
Expand All @@ -119,6 +116,9 @@ export const requestPhoneCodeForAuthedUser = async ({
return true
}

const checkedChannel = checkedToChannel(phone, channel)
if (checkedChannel instanceof Error) return checkedChannel

return TwilioClient().initiateVerify({
to: phone,
channel: checkedChannel,
Expand Down Expand Up @@ -154,9 +154,6 @@ export const requestPhoneCodeWithAppcheckJti = async ({
if (limitOk instanceof Error) return limitOk
}

const checkedChannel = checkedToChannel(phone, channel)
if (checkedChannel instanceof Error) return checkedChannel

if (UNSECURE_DEFAULT_LOGIN_CODE) {
return true
}
Expand All @@ -173,6 +170,9 @@ export const requestPhoneCodeWithAppcheckJti = async ({
const user = await UsersRepository().findByPhone(phone)
const phoneExists = !(user instanceof Error)

const checkedChannel = checkedToChannel(phone, channel)
if (checkedChannel instanceof Error) return checkedChannel

return TwilioClient().initiateVerify({
to: phone,
channel: checkedChannel,
Expand Down

0 comments on commit bf7871e

Please sign in to comment.