Files
AFFiNE-Mirror/packages/backend/server/src/plugins/captcha/controller.ts
T
2024-12-13 06:27:13 +00:00

18 lines
424 B
TypeScript

import { Controller, Get } from '@nestjs/common';
import { Throttle } from '../../base';
import { Public } from '../../core/auth';
import { CaptchaService } from './service';
@Throttle('strict')
@Controller('/api/auth')
export class CaptchaController {
constructor(private readonly captcha: CaptchaService) {}
@Public()
@Get('/challenge')
async getChallenge() {
return this.captcha.getChallengeToken();
}
}