From 3408f642431db3dc2e3b6c3070017fd7203452bf Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 16 Jun 2023 11:18:58 +0800 Subject: [PATCH] fix(nocodb): add missing GlobalGuard on signout --- packages/nocodb/src/controllers/users/users.controller.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/controllers/users/users.controller.ts b/packages/nocodb/src/controllers/users/users.controller.ts index 0c8f153c78..ec94567d43 100644 --- a/packages/nocodb/src/controllers/users/users.controller.ts +++ b/packages/nocodb/src/controllers/users/users.controller.ts @@ -73,11 +73,15 @@ export class UsersController { res.json(this.usersService.login(req.user)); } + @UseGuards(GlobalGuard) @Post('/api/v1/auth/user/signout') @HttpCode(200) - async signout(@Request() req, @Response() res): Promise { + async signOut(@Request() req, @Response() res): Promise { + if (!(req as any).isAuthenticated()) { + NcError.forbidden('Not allowed'); + } res.json( - await this.usersService.signout({ + await this.usersService.signOut({ req, res, }),