feat: mandatory password change on login + UI fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
'use strict'
|
||||
/* global WIKI */
|
||||
|
||||
/**
|
||||
* Security Middleware
|
||||
@@ -13,7 +13,9 @@ module.exports = function (req, res, next) {
|
||||
req.app.disable('x-powered-by')
|
||||
|
||||
// -> Disable Frame Embedding
|
||||
res.set('X-Frame-Options', 'deny')
|
||||
if (WIKI.config.securityIframe) {
|
||||
res.set('X-Frame-Options', 'deny')
|
||||
}
|
||||
|
||||
// -> Re-enable XSS Fitler if disabled
|
||||
res.set('X-XSS-Protection', '1; mode=block')
|
||||
@@ -25,7 +27,14 @@ module.exports = function (req, res, next) {
|
||||
res.set('X-UA-Compatible', 'IE=edge')
|
||||
|
||||
// -> Disables referrer header when navigating to a different origin
|
||||
res.set('Referrer-Policy', 'same-origin')
|
||||
if (WIKI.config.securityReferrerPolicy) {
|
||||
res.set('Referrer-Policy', 'same-origin')
|
||||
}
|
||||
|
||||
// -> Enforce HSTS
|
||||
if (WIKI.config.securityHSTS) {
|
||||
res.set('Strict-Transport-Security', `max-age=${WIKI.config.securityHSTSDuration}; includeSubDomains`)
|
||||
}
|
||||
|
||||
return next()
|
||||
}
|
||||
|
Reference in New Issue
Block a user