mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-13 16:16:46 +08:00
refactor(server): standalone runtime module (#9120)
This commit is contained in:
@@ -6,9 +6,9 @@ import type {
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import {
|
||||
Config,
|
||||
getRequestResponseFromContext,
|
||||
GuardProvider,
|
||||
Runtime,
|
||||
} from '../../base';
|
||||
import { CaptchaService } from './service';
|
||||
|
||||
@@ -21,13 +21,13 @@ export class CaptchaGuardProvider
|
||||
|
||||
constructor(
|
||||
private readonly captcha: CaptchaService,
|
||||
private readonly config: Config
|
||||
private readonly runtime: Runtime
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
async canActivate(context: ExecutionContext) {
|
||||
if (!(await this.config.runtime.fetch('plugins.captcha/enable'))) {
|
||||
if (!(await this.runtime.fetch('plugins.captcha/enable'))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user