From d6c9bd08fad4dd42ead899d8adb4fac23452a3ab Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Wed, 2 Sep 2020 12:10:05 +0200 Subject: [PATCH] Fix external authentication goth lib was initialized before settings Fix #107 --- system/app.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/system/app.go b/system/app.go index c5d0af108..d7cb4a78e 100644 --- a/system/app.go +++ b/system/app.go @@ -3,7 +3,6 @@ package system import ( "context" "github.com/cortezaproject/corteza-server/pkg/automation" - "github.com/go-chi/chi" _ "github.com/joho/godotenv/autoload" "github.com/spf13/cobra" @@ -71,8 +70,6 @@ func (app *App) Initialize(ctx context.Context) (err error) { return } - // Initialize external authentication (from default settings) - external.Init() return } @@ -83,6 +80,12 @@ func (app *App) Activate(ctx context.Context) (err error) { service.Watchers(ctx) + // Initialize external authentication + // + // We're relying on current settings to be loaded at this point so + // we need to run init AFTER service activation + external.Init() + return }