diff --git a/src/plugins/index.js b/src/plugins/index.js index a1d1fcac1e..ee5dd30f90 100644 --- a/src/plugins/index.js +++ b/src/plugins/index.js @@ -8,6 +8,8 @@ const semver = require('semver'); const nconf = require('nconf'); const util = require('util'); +const user = require('../user'); + const readdirAsync = util.promisify(fs.readdir); var app; @@ -104,6 +106,8 @@ Plugins.reload = async function () { Plugins.libraryPaths.length = 0; Plugins.loadedPlugins.length = 0; + await user.addInterstitials(); + const paths = await Plugins.getPluginPaths(); for (const path of paths) { /* eslint-disable no-await-in-loop */ diff --git a/src/routes/index.js b/src/routes/index.js index 3a9bc4db56..561ae8ee1f 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -8,7 +8,6 @@ var express = require('express'); var meta = require('../meta'); var controllers = require('../controllers'); var plugins = require('../plugins'); -var user = require('../user'); var accountRoutes = require('./accounts'); var metaRoutes = require('./meta'); @@ -111,7 +110,6 @@ module.exports = async function (app, middleware) { await plugins.reloadRoutes({ router: router }); await authRoutes.reloadRoutes({ router: router }); addCoreRoutes(app, router, middleware); - await user.addInterstitials(); winston.info('Routes added'); };