From 65246cb2807cb60b2de976bfc792ac1abb67e0b9 Mon Sep 17 00:00:00 2001 From: Mickael KERJEAN Date: Fri, 7 Sep 2018 13:28:15 +1000 Subject: [PATCH] feature (custombackend): fix custombackend --- client/pages/connectpage/form.js | 21 +++++++++++++++++++-- server/router/session.go | 3 +-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/client/pages/connectpage/form.js b/client/pages/connectpage/form.js index d2e239ae..84808500 100644 --- a/client/pages/connectpage/form.js +++ b/client/pages/connectpage/form.js @@ -420,8 +420,14 @@ const DropboxForm = formHelper(function(props){ const redirect = () => { return props.onThirdPartyLogin("dropbox"); }; - if(CONFIG.connections.length === 1){ + + if(CONFIG.connections.length === 1 && CONFIG.auto_connect === true){ redirect(); + return ( +
+ AUTHENTICATING ... +
+ ); } return (
@@ -437,8 +443,14 @@ const GDriveForm = formHelper(function(props){ const redirect = () => { return props.onThirdPartyLogin("google"); }; - if(CONFIG.connections.length === 1){ + + if(CONFIG.connections.length === 1 && CONFIG.auto_connect === true){ redirect(); + return ( +
+ AUTHENTICATING ... +
+ ); } return (
@@ -457,6 +469,11 @@ const CustomForm = formHelper(function(props){ if(CONFIG.connections.length === 1 && CONFIG.auto_connect === true){ redirect(); + return ( +
+ AUTHENTICATING ... +
+ ); } return (
diff --git a/server/router/session.go b/server/router/session.go index 9b184fb7..5933f719 100644 --- a/server/router/session.go +++ b/server/router/session.go @@ -1,7 +1,6 @@ package router import ( - "errors" "github.com/mickael-kerjean/mux" . "github.com/mickael-kerjean/nuage/server/common" "github.com/mickael-kerjean/nuage/server/model" @@ -110,7 +109,7 @@ func SessionOAuthBackend(ctx App, res http.ResponseWriter, req *http.Request) { } obj, ok := b.(interface{ OAuthURL() string }) if ok == false { - sendErrorResult(res, errors.New("No backend authentication")) + sendErrorResult(res, NewError("No backend authentication ("+b.Info()+")", 500)) return } sendSuccessResult(res, obj.OAuthURL())