From 2dd25abbdd01fd3490fdb57d543aa8c3021b0505 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 15 Dec 2017 14:16:44 -0800 Subject: [PATCH] Move initOAuth attacher out of core constructor --- src/core/index.js | 2 -- src/core/plugins/auth/index.js | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/index.js b/src/core/index.js index c34b91b6..544f16d8 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -104,8 +104,6 @@ module.exports = function SwaggerUI(opts) { var system = store.getSystem() - system.initOAuth = system.authActions.configureAuth - const downloadSpec = (fetchedConfig) => { if(typeof constructorConfig !== "object") { return system diff --git a/src/core/plugins/auth/index.js b/src/core/plugins/auth/index.js index 0937f805..7e9413f4 100644 --- a/src/core/plugins/auth/index.js +++ b/src/core/plugins/auth/index.js @@ -5,6 +5,9 @@ import * as specWrapActionReplacements from "./spec-wrap-actions" export default function() { return { + afterLoad(system) { + system.initOAuth = system.authActions.configureAuth + }, statePlugins: { auth: { reducers,