Skip to content

Commit

Permalink
Merge branch 'import-repo' into delegate-create-account
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Nov 1, 2023
2 parents 4f53ff4 + dc4aa22 commit 79915b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/pds/src/auth-verifier.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { KeyObject, createPublicKey, createSecretKey } from 'node:crypto'
import {
AuthRequiredError,
ForbiddenError,
InvalidRequestError,
verifyJwt as verifyServiceJwt,
} from '@atproto/xrpc-server'
Expand All @@ -10,6 +11,7 @@ import express from 'express'
import * as jose from 'jose'
import KeyEncoder from 'key-encoder'
import { AccountManager } from './account-manager'
import { softDeleted } from './db'

type ReqCtx = {
req: express.Request
Expand Down Expand Up @@ -121,6 +123,10 @@ export class AuthVerifier {
])
const found = await this.accountManager.getAccount(result.credentials.did)
if (!found) {
// will be turned into ExpiredToken for the client if proxied by entryway
throw new ForbiddenError('Account not found', 'AccountNotFound')
}
if (softDeleted(found)) {
throw new AuthRequiredError(
'Account has been taken down',
'AccountTakedown',
Expand Down

0 comments on commit 79915b5

Please sign in to comment.