diff --git a/packages/ripple-nuxt-tide/lib/core/basic-auth.js b/packages/ripple-nuxt-tide/lib/core/basic-auth.js index 8704bd1ab..43fdc6547 100644 --- a/packages/ripple-nuxt-tide/lib/core/basic-auth.js +++ b/packages/ripple-nuxt-tide/lib/core/basic-auth.js @@ -1,7 +1,7 @@ // Server middleware - only allow users who pass const auth = require('basic-auth') -export default function (req, res, next) { +module.exports = function (req, res, next) { const credentials = auth(req) // We need to use same credentials as Content API, as we are using proxy to send API requests. const authUser = process.env.CONTENT_API_AUTH_USER diff --git a/packages/ripple-nuxt-tide/lib/module.js b/packages/ripple-nuxt-tide/lib/module.js index c6395e732..78255f345 100644 --- a/packages/ripple-nuxt-tide/lib/module.js +++ b/packages/ripple-nuxt-tide/lib/module.js @@ -63,7 +63,8 @@ const nuxtTide = function (moduleOptions) { }) if (process.env.BASIC_AUTH === '1') { - this.addServerMiddleware('./core/basic-auth.js') + const basicAuth = require('./core/basic-auth.js') + this.addServerMiddleware(basicAuth) } this.addModule('@dpc-sdp/ripple-nuxt-ui', true)