diff --git a/src/routes/v2/auth.js b/src/routes/v2/auth.js index 90f82027d..e50f4cec1 100644 --- a/src/routes/v2/auth.js +++ b/src/routes/v2/auth.js @@ -17,7 +17,12 @@ const CSRF_COOKIE_NAME = "isomer-csrf" const COOKIE_NAME = "isomercms" class AuthRouter { - constructor({ authService, authenticationMiddleware, apiLogger, rateLimiter }) { + constructor({ + authService, + authenticationMiddleware, + apiLogger, + rateLimiter, + }) { this.authService = authService this.authenticationMiddleware = authenticationMiddleware this.apiLogger = apiLogger @@ -46,7 +51,7 @@ class AuthRouter { const cookieSettings = { expires: csrfTokenExpiry, httpOnly: true, - secure: isSecure(), + secure: isSecure, } res.cookie(CSRF_COOKIE_NAME, cookieToken, cookieSettings) return res.redirect(redirectUrl) diff --git a/src/utils/auth-utils.js b/src/utils/auth-utils.js index 57106bbe4..460823425 100644 --- a/src/utils/auth-utils.js +++ b/src/utils/auth-utils.js @@ -2,9 +2,7 @@ const { config } = require("@config/config") const NODE_ENV = config.get("env") -function isSecure() { - return NODE_ENV !== "dev" && NODE_ENV !== "test" -} +const isSecure = NODE_ENV !== "dev" && NODE_ENV !== "test" module.exports = { isSecure,