Skip to content

Commit

Permalink
createAccoutn error based on user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Feb 5, 2024
1 parent 444fc09 commit f0754f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/pds/src/api/com/atproto/server/createAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export default function (server: Server, ctx: AppContext) {
},
handler: async ({ input, req }) => {
const hasAvailability = await ctx.signupLimiter.hasAvailability()
if (!hasAvailability && req.header('user-agent')?.startsWith('okhttp/')) {
throw new InvalidRequestError(
`We've had a burst of activity and are temporarily limiting signups. Please check back soon!`,
)
}

const {
did,
Expand Down

0 comments on commit f0754f6

Please sign in to comment.