Skip to content

Commit

Permalink
fix addServerMiddleware middleware (#448)
Browse files Browse the repository at this point in the history
* fix addServerMiddleware middleware

* Changed export default to module export
  • Loading branch information
dylankelly authored and tim-yao committed Jul 24, 2019
1 parent 55e4f84 commit dcb401c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ripple-nuxt-tide/lib/core/basic-auth.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion packages/ripple-nuxt-tide/lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dcb401c

Please sign in to comment.