@@ -19,6 +19,7 @@ import { AuthGuard } from './auth.guard';
19
19
import { LoginDTO } from './dto/login.dto' ;
20
20
import { ApiResponse } from '@nestjs/swagger' ;
21
21
import { AuthedReq } from 'src/utils/types/AuthedReq.type' ;
22
+ import { STAGING_API } from 'src/utils' ;
22
23
23
24
@Controller ( { path : 'auth' } )
24
25
export class AuthController {
@@ -49,10 +50,7 @@ export class AuthController {
49
50
res . clearCookie ( 'auth' , {
50
51
httpOnly : true ,
51
52
// sameSite: process.env.NODE_ENV === 'staging' ? 'none' : 'lax',
52
- domain :
53
- process . env . NODE_ENV === 'development'
54
- ? undefined
55
- : 'pairwise.generalmagic.io' ,
53
+ domain : process . env . NODE_ENV === 'development' ? undefined : STAGING_API ,
56
54
secure : true ,
57
55
} ) ;
58
56
res . send ( 'Logged out.' ) ;
@@ -93,10 +91,7 @@ export class AuthController {
93
91
res . cookie ( 'auth' , nonce , {
94
92
httpOnly : true ,
95
93
// sameSite: process.env.NODE_ENV === 'staging' ? 'none' : 'lax',
96
- domain :
97
- process . env . NODE_ENV === 'development'
98
- ? undefined
99
- : 'pairwise.generalmagic.io' ,
94
+ domain : process . env . NODE_ENV === 'development' ? undefined : STAGING_API ,
100
95
secure : true ,
101
96
expires : new Date ( Date . now ( ) + this . authService . TokenExpirationDuration ) ,
102
97
} ) ;
0 commit comments