Skip to content

Commit 451eea6

Browse files
committed
fix: cookie response from backend in auth controller
1 parent 287ada3 commit 451eea6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/src/auth/auth.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class AuthController {
1616
@Res({ passthrough: true }) res: Response,
1717
) {
1818
const { user, token } = await this.authservice.register(dto);
19-
res.cookie('jwt', token, { httpOnly: true });
19+
res.cookie('jwt', token, { httpOnly: true, sameSite: 'lax' });
2020
return user;
2121
}
2222

@@ -26,7 +26,7 @@ export class AuthController {
2626
@Res({ passthrough: true }) res: Response,
2727
) {
2828
const { user, token } = await this.authservice.login(dto);
29-
res.cookie('jwt', token, { httpOnly: true });
29+
res.cookie('jwt', token, { httpOnly: true, sameSite: 'lax' });
3030
return user;
3131
}
3232

0 commit comments

Comments
 (0)