Skip to content

Commit

Permalink
Merge pull request #1851 from bluesky-social/catch-handle-validation-err
Browse files Browse the repository at this point in the history
catch handle validation error
  • Loading branch information
dholms authored Nov 14, 2023
2 parents bbae744 + 99e6165 commit 90dda88
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/pds/src/api/com/atproto/server/createAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { AtprotoData, ensureAtpDocument } from '@atproto/identity'
import { InvalidRequestError } from '@atproto/xrpc-server'
import { ExportableKeypair, Keypair, Secp256k1Keypair } from '@atproto/crypto'
import disposable from 'disposable-email'
import { normalizeAndValidateHandle } from '../../../../handle'
import {
baseNormalizeAndValidate,
normalizeAndValidateHandle,
} from '../../../../handle'
import * as plc from '@did-plc/lib'
import { Server } from '../../../../lexicon'
import { InputSchema as CreateAccountInput } from '../../../../lexicon/types/com/atproto/server/createAccount'
Expand Down Expand Up @@ -80,7 +83,8 @@ const validateInputsForEntrywayPds = async (
ctx: AppContext,
input: CreateAccountInput,
) => {
const { did, handle, plcOp } = input
const { did, plcOp } = input
const handle = baseNormalizeAndValidate(input.handle)
if (!did || !input.plcOp) {
throw new InvalidRequestError(
'non-entryway pds requires bringing a DID and plcOp',
Expand Down Expand Up @@ -255,7 +259,7 @@ const validateExistingDid = async (
return { did: did, plcOp: null }
}

const validateAtprotoData = async (
const validateAtprotoData = (
data: AtprotoData,
expected: {
handle: string
Expand Down

0 comments on commit 90dda88

Please sign in to comment.