Skip to content

Commit

Permalink
fix: do not enforce captcha for admins
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jan 16, 2023
1 parent b86de44 commit 75ff59a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@ class Policies {
async ensureCaptcha(ctx, next) {
if (this.config.hcaptchaEnabled === false) return next();

if (
ctx.isAuthenticated() &&
ctx.state.user &&
ctx.state.user.group === 'admin'
)
return next();

if (!isSANB(ctx.request.body['h-captcha-response'])) {
const err = Boom.badRequest(
ctx.translate
Expand Down

0 comments on commit 75ff59a

Please sign in to comment.