Skip to content

Commit

Permalink
Enable middleware client-side & force middleware globally
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgv committed Nov 12, 2017
1 parent a312b7b commit 81017d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ module.exports = function (moduleOptions) {
fileName: 'i18n.routing.middleware.js',
options: templatesOptions
})
this.options.router.middleware.push('i18n')
}
1 change: 0 additions & 1 deletion lib/templates/i18n.routing.middleware.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import middleware from './middleware'

middleware['i18n'] = function authMiddleware ({ app, store, route, error, hotReload, isServer }) {
if (!isServer) return
const locales = <%= options.locales %>
const defaultLocale = '<%= options.defaultLocale %>'
// Check if middleware called from hot-reloading, ignore
Expand Down

0 comments on commit 81017d2

Please sign in to comment.