Skip to content

Commit

Permalink
fix: captcha guard init
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed May 21, 2024
1 parent 54211fb commit 3efcd11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/backend/server/src/plugins/captcha/guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export class CaptchaGuard implements CanActivate, OnModuleInit {
constructor(private readonly ref: ModuleRef) {}

onModuleInit() {
this.captcha = this.ref.get(CaptchaService, { strict: false });
try {
this.captcha = this.ref.get(CaptchaService, { strict: false });
} catch {
// ignore
}
}

async canActivate(context: ExecutionContext) {
Expand Down

0 comments on commit 3efcd11

Please sign in to comment.