mirror of
https://github.com/mickael-kerjean/filestash
synced 2026-01-03 22:33:08 +01:00
feature (custombackend): fix custombackend
This commit is contained in:
parent
96b41945ab
commit
65246cb280
2 changed files with 20 additions and 4 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Reference in a new issue