File tree 3 files changed +5
-12
lines changed
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';
18
18
import { Response } from 'express' ;
19
19
import { AuthorizedRequest } from './entities/authorized-request.entity' ;
20
20
import { Throttle } from '@nestjs/throttler' ;
21
- import { appConfig } from 'src/config' ;
22
21
23
22
@Throttle ( { default : { limit : 2 , ttl : 60000 } } )
24
23
@ApiTags ( 'auth' )
@@ -34,9 +33,9 @@ export class AuthController {
34
33
) {
35
34
const token = await this . service . login ( loginDto . email , loginDto . password ) ;
36
35
res . cookie ( 'accessToken' , token . access_token , {
37
- sameSite : 'none' ,
38
- domain : appConfig . frontendDomain ,
36
+ sameSite : 'strict' ,
39
37
} ) ;
38
+
40
39
return token ;
41
40
}
42
41
@@ -48,8 +47,7 @@ export class AuthController {
48
47
) : Promise < RegisterResponseDto > {
49
48
const token = await this . service . register ( registerDto ) ;
50
49
res . cookie ( 'accessToken' , token . access_token , {
51
- sameSite : 'none' ,
52
- domain : appConfig . frontendDomain ,
50
+ sameSite : 'strict' ,
53
51
} ) ;
54
52
return token ;
55
53
}
Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ export const appConfig = {
23
23
port : parseInt ( fromEnv ( 'REDIS_PORT' ) ) ,
24
24
} ,
25
25
26
- frontendDomain : fromEnv ( 'FRONTEND_DOMAIN' ) ,
27
-
28
26
debug : fromEnv ( 'DEBUG' , 'false' ) . toLowerCase ( ) === 'true' ,
29
27
} ;
30
28
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { AuthService } from 'src/auth/auth.service';
9
9
import { OAuthProvider } from 'src/users/dto/find-or-create-user.dto' ;
10
10
import { Response } from 'express' ;
11
11
import { oauthConfig } from './config' ;
12
- import { appConfig } from 'src/config' ;
13
12
14
13
@ApiTags ( 'oauth' )
15
14
@Public ( )
@@ -41,8 +40,7 @@ export class OauthController {
41
40
42
41
const token = await this . authService . generateJwtToken ( user . email ) ;
43
42
res . cookie ( 'accessToken' , token , {
44
- sameSite : 'none' ,
45
- domain : appConfig . frontendDomain ,
43
+ sameSite : 'strict' ,
46
44
} ) ;
47
45
res . redirect ( oauthConfig . frontendUrl ) ;
48
46
}
@@ -66,8 +64,7 @@ export class OauthController {
66
64
} ) ;
67
65
const token = await this . authService . generateJwtToken ( user . email ) ;
68
66
res . cookie ( 'accessToken' , token , {
69
- sameSite : 'none' ,
70
- domain : appConfig . frontendDomain ,
67
+ sameSite : 'strict' ,
71
68
} ) ;
72
69
res . redirect ( oauthConfig . frontendUrl ) ;
73
70
}
You can’t perform that action at this time.
0 commit comments