feat: 飞书登录修改public路由

This commit is contained in:
lichao 2025-05-30 09:59:53 +01:00
parent 49a38f7bce
commit 7d5e734e39
1 changed files with 4 additions and 1 deletions

View File

@ -1,18 +1,21 @@
import { Controller, Get, Query, Res } from '@nestjs/common';
import { LarkService } from './lark.service';
import { Response } from 'express';
import { Public } from '../auth/decorators/public.decorator';
@Controller('lark')
export class LarkController {
constructor(private readonly larkService: LarkService) { }
@Get('login')
@Public()
async login(@Query('redirectUri') redirectUri: string, @Res() res: Response) {
const loginUrl = await this.larkService.getLoginUrl(redirectUri);
return res.redirect(loginUrl);
}
@Get('callback')
@Public()
async callback(@Query('code') code: string, @Res() res: Response) {
if (!code) {
return res.status(400).send('Authorization code is missing');