summaryrefslogtreecommitdiffstats
path: root/core/Controller/ClientFlowLoginController.php
diff options
context:
space:
mode:
authorMario Danic <mario@lovelyhq.com>2017-11-09 00:29:34 +0100
committerMario Danic <mario@lovelyhq.com>2017-11-09 00:29:34 +0100
commitc2cd5fc5d345a61b6cc251d2974f199f4e8c04f8 (patch)
tree1da215a5c442419fe8c4886cfb3d8d11a6d46575 /core/Controller/ClientFlowLoginController.php
parent989a8a3668ee2f8214bc0391b8d38f1e9b99bde0 (diff)
downloadnextcloud-server-c2cd5fc5d345a61b6cc251d2974f199f4e8c04f8.tar.gz
nextcloud-server-c2cd5fc5d345a61b6cc251d2974f199f4e8c04f8.zip
Fix flow
Signed-off-by: Mario Danic <mario@lovelyhq.com>
Diffstat (limited to 'core/Controller/ClientFlowLoginController.php')
-rw-r--r--core/Controller/ClientFlowLoginController.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php
index 81ba8009b24..47bbbce640e 100644
--- a/core/Controller/ClientFlowLoginController.php
+++ b/core/Controller/ClientFlowLoginController.php
@@ -307,7 +307,16 @@ class ClientFlowLoginController extends Controller {
);
$this->session->remove('oauth.state');
} else {
- $redirectUri = 'nc://login/server:' . $this->request->getServerHost() . '&user:' . urlencode($loginName) . '&password:' . urlencode($token);
+ $serverPostfix = '';
+
+ if (strpos($this->request->getRequestUri(), '/index.php') !== false) {
+ $serverPostfix = substr($this->request->getRequestUri(), 0, strpos($this->request->getRequestUri(), '/index.php'));
+ } else if (strpos($this->request->getRequestUri(), '/login/flow') !== false) {
+ $serverPostfix = substr($this->request->getRequestUri(), 0, strpos($this->request->getRequestUri(), '/login/flow'));
+ }
+
+ $serverPath = $this->request->getServerProtocol() . "://" . $this->request->getServerHost() . $serverPostfix;
+ $redirectUri = 'nc://login/server:' . $serverPath . '&user:' . urlencode($loginName) . '&password:' . urlencode($token);
}
return new Http\RedirectResponse($redirectUri);