feature (custombackend): fix custombackend

This commit is contained in:
Mickael KERJEAN 2018-09-07 13:28:15 +10:00
parent 96b41945ab
commit 65246cb280
2 changed files with 20 additions and 4 deletions

View file

@ -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 (
<div>
AUTHENTICATING ...
</div>
);
}
return (
<div>
@ -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 (
<div>
AUTHENTICATING ...
</div>
);
}
return (
<div>
@ -457,6 +469,11 @@ const CustomForm = formHelper(function(props){
if(CONFIG.connections.length === 1 && CONFIG.auto_connect === true){
redirect();
return (
<div>
AUTHENTICATING ...
</div>
);
}
return (
<div>

View file

@ -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())