Skip to content
Snippets Groups Projects
Commit 9ca59f13 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Add secure flag to cookies and remove logs

parent d25835a8
Branches
Tags
No related merge requests found
Pipeline #
...@@ -30,8 +30,6 @@ export class AuthenticationController { ...@@ -30,8 +30,6 @@ export class AuthenticationController {
async legacyLogin(@Body() body: LoginForm, @Res() res: Response) { async legacyLogin(@Body() body: LoginForm, @Res() res: Response) {
try { try {
const loginResult = await this._authService.legacyLogin(body); const loginResult = await this._authService.legacyLogin(body);
Logger.log(this._configService.config.accessTokenCookieKey);
Logger.log(this._configService.config.cookieDomain);
res.cookie( res.cookie(
this._configService.config.accessTokenCookieKey, this._configService.config.accessTokenCookieKey,
loginResult.jwtToken, loginResult.jwtToken,
...@@ -39,7 +37,7 @@ export class AuthenticationController { ...@@ -39,7 +37,7 @@ export class AuthenticationController {
domain: this._configService.config.cookieDomain, domain: this._configService.config.cookieDomain,
expires: new Date(Date.now() + 900000), expires: new Date(Date.now() + 900000),
httpOnly: true, httpOnly: true,
// secure: true, secure: true,
}, },
).status(HttpStatus.OK).send({ userInfo: loginResult.userInfo, xsrfToken: loginResult.xsrfToken }); ).status(HttpStatus.OK).send({ userInfo: loginResult.userInfo, xsrfToken: loginResult.xsrfToken });
} catch (error) { } catch (error) {
...@@ -122,7 +120,7 @@ export class AuthenticationController { ...@@ -122,7 +120,7 @@ export class AuthenticationController {
domain: this._configService.config.cookieDomain, domain: this._configService.config.cookieDomain,
expires: new Date(Date.now() + 900000), expires: new Date(Date.now() + 900000),
httpOnly: true, httpOnly: true,
// secure: true, secure: true,
}, },
).status(HttpStatus.OK).send({ userInfo: updateResult.userInfo, xsrfToken: updateResult.xsrfToken }); ).status(HttpStatus.OK).send({ userInfo: updateResult.userInfo, xsrfToken: updateResult.xsrfToken });
} catch (error) { } catch (error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment