feat(query-params): proper handling in case of invalid credentials
This commit is contained in:
committed by
Benedikt Rötsch
parent
ff305e7d34
commit
46074b508d
@@ -4,9 +4,6 @@
|
||||
*/
|
||||
|
||||
const { initClients } = require('../services/contentful')
|
||||
const { updateCookie } = require('./cookies')
|
||||
|
||||
const SETTINGS_NAME = 'theExampleAppSettings'
|
||||
|
||||
module.exports = async function settingsMiddleware (request, response, next) {
|
||||
// Set default settings based on environment variables
|
||||
@@ -28,7 +25,6 @@ module.exports = async function settingsMiddleware (request, response, next) {
|
||||
deliveryToken: delivery_token,
|
||||
previewToken: preview_token
|
||||
}
|
||||
updateCookie(response, SETTINGS_NAME, settings)
|
||||
}
|
||||
|
||||
// Allow enabling and disabling of editorial features via query parameters
|
||||
@@ -37,7 +33,6 @@ module.exports = async function settingsMiddleware (request, response, next) {
|
||||
if (typeof editorial_features !== 'undefined') {
|
||||
delete request.query.editorial_features
|
||||
settings.editorialFeatures = editorial_features === 'enabled'
|
||||
updateCookie(response, SETTINGS_NAME, settings)
|
||||
}
|
||||
/* eslint-enable camelcase */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user