File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,14 @@ import {
66 Post ,
77 Res ,
88 UseFilters ,
9+ UseGuards ,
910} from '@nestjs/common' ;
10- import { Response } from 'express' ;
11+ import { Response , Request } from 'express' ;
1112import { AuthService } from './auth.service' ;
1213import { Public } from './decorators/public.decorator' ;
1314import { GetCurrentUser , GetCurrentUserId } from '../common/decorators' ;
1415import { HttpExceptionFilter } from '../utils/http-exception.filter' ;
16+ import { AuthGuard } from '../common/guards/index' ;
1517
1618@Controller ( 'auth' )
1719export class AuthController {
@@ -32,15 +34,18 @@ export class AuthController {
3234 return access_token ;
3335 }
3436
35- @Public ( )
37+ // @Public ()
38+ @UseGuards ( AuthGuard )
3639 @Post ( '/refresh' )
3740 @UseFilters ( new HttpExceptionFilter ( ) )
3841 @HttpCode ( HttpStatus . OK )
3942 async refreshTokens (
40- @ GetCurrentUser ( 'refreshToken' ) refreshToken : string ,
41- @ GetCurrentUserId ( ) userId : string ,
43+ @ Res ( ) request : Request ,
44+ @ Res ( ) res : Response
4245 ) {
43- return await this . authService . refreshTokens ( userId , refreshToken ) ;
46+ // console.log(request);
47+ return res . sendStatus ( 200 )
48+ // return await this.authService.refreshTokens(userId, refreshToken);
4449 }
4550
4651
You can’t perform that action at this time.
0 commit comments