Skip to content

Commit

Permalink
trim earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Jan 31, 2024
1 parent a602a12 commit 1f9a518
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/pds/src/api/com/atproto/server/createAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function (server: Server, ctx: AppContext) {
const verificationPhone = await ensurePhoneVerification(
ctx,
input.body.verificationPhone,
input.body.verificationCode,
input.body.verificationCode?.trim(),
)

const result = await ctx.db.transaction(async (dbTxn) => {
Expand Down Expand Up @@ -490,7 +490,7 @@ const ensurePhoneVerification = async (
)
}
const normalizedPhone = ctx.twilio.normalizePhoneNumber(phone)
const verified = await ctx.twilio.verifyCode(normalizedPhone, code.trim())
const verified = await ctx.twilio.verifyCode(normalizedPhone, code)
if (!verified) {
throw new InvalidRequestError(
'Could not verify phone number. Please try again.',
Expand Down

0 comments on commit 1f9a518

Please sign in to comment.