File tree Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ import { UserPermsOutDto } from 'src/users/dto/user-perms-out.dto';
1818import { Response } from 'express' ;
1919import { AuthorizedRequest } from './entities/authorized-request.entity' ;
2020import { Throttle } from '@nestjs/throttler' ;
21- import { appConfig } from 'src/config' ;
2221
2322@Throttle ( { default : { limit : 2 , ttl : 60000 } } )
2423@ApiTags ( 'auth' )
@@ -34,9 +33,9 @@ export class AuthController {
3433 ) {
3534 const token = await this . service . login ( loginDto . email , loginDto . password ) ;
3635 res . cookie ( 'accessToken' , token . access_token , {
37- sameSite : 'none' ,
38- domain : appConfig . frontendDomain ,
36+ sameSite : 'strict' ,
3937 } ) ;
38+
4039 return token ;
4140 }
4241
@@ -48,8 +47,7 @@ export class AuthController {
4847 ) : Promise < RegisterResponseDto > {
4948 const token = await this . service . register ( registerDto ) ;
5049 res . cookie ( 'accessToken' , token . access_token , {
51- sameSite : 'none' ,
52- domain : appConfig . frontendDomain ,
50+ sameSite : 'strict' ,
5351 } ) ;
5452 return token ;
5553 }
Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ export const appConfig = {
2323 port : parseInt ( fromEnv ( 'REDIS_PORT' ) ) ,
2424 } ,
2525
26- frontendDomain : fromEnv ( 'FRONTEND_DOMAIN' ) ,
27-
2826 debug : fromEnv ( 'DEBUG' , 'false' ) . toLowerCase ( ) === 'true' ,
2927} ;
3028
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { AuthService } from 'src/auth/auth.service';
99import { OAuthProvider } from 'src/users/dto/find-or-create-user.dto' ;
1010import { Response } from 'express' ;
1111import { oauthConfig } from './config' ;
12- import { appConfig } from 'src/config' ;
1312
1413@ApiTags ( 'oauth' )
1514@Public ( )
@@ -41,8 +40,7 @@ export class OauthController {
4140
4241 const token = await this . authService . generateJwtToken ( user . email ) ;
4342 res . cookie ( 'accessToken' , token , {
44- sameSite : 'none' ,
45- domain : appConfig . frontendDomain ,
43+ sameSite : 'strict' ,
4644 } ) ;
4745 res . redirect ( oauthConfig . frontendUrl ) ;
4846 }
@@ -66,8 +64,7 @@ export class OauthController {
6664 } ) ;
6765 const token = await this . authService . generateJwtToken ( user . email ) ;
6866 res . cookie ( 'accessToken' , token , {
69- sameSite : 'none' ,
70- domain : appConfig . frontendDomain ,
67+ sameSite : 'strict' ,
7168 } ) ;
7269 res . redirect ( oauthConfig . frontendUrl ) ;
7370 }
You can’t perform that action at this time.
0 commit comments