]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update login flow redirection 4588/head
authorMario Danic <mario@lovelyhq.com>
Fri, 28 Apr 2017 21:33:09 +0000 (23:33 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Thu, 4 May 2017 17:21:22 +0000 (19:21 +0200)
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
core/Controller/ClientFlowLoginController.php
core/js/login/authpicker.js
tests/Core/Controller/ClientFlowLoginControllerTest.php

index ca9c092321aa7284cbbfc419ed9ec74fa9771740..8c2c121d5b21f4c6f777e4e63409a1115025739d 100644 (file)
@@ -232,7 +232,7 @@ class ClientFlowLoginController extends Controller {
                        IToken::DO_NOT_REMEMBER
                );
 
-               return new Http\RedirectResponse('nc://' . urlencode($loginName) . ':' . urlencode($token) . '@' . $this->request->getServerHost());
+               return new Http\RedirectResponse('nc://login/server:' . $this->request->getServerHost() . '&user:' . urlencode($loginName) . '&password:' . urlencode($token));
        }
 
 }
index 666a63da3655c3a66646bd5cde2e1bd17c892ee9..2d4bcc33158d3151c55bc6ae236501313c987f89 100644 (file)
@@ -8,8 +8,9 @@ jQuery(document).ready(function() {
 
        $('#submit-app-token-login').click(function(e) {
                e.preventDefault();
-               window.location.href = 'nc://'
-                       + encodeURIComponent($('#user').val()) + ':' + encodeURIComponent($('#password').val())
-                       + '@' + encodeURIComponent($('#serverHost').val());
+               window.location.href = 'nc://login/server:'
+                       + encodeURIComponent($('#serverHost').val())
+                       + "&user:" +  encodeURIComponent($('#user').val())
+                       + "&password:" + encodeURIComponent($('#password').val());
        });
 });
index 7c525b53210112d290504605a5adfb74116a23ee..7a98e5c26c6a293f24b85bc9d29e36948827c9d3 100644 (file)
@@ -338,7 +338,7 @@ class ClientFlowLoginControllerTest extends TestCase {
                        ->method('getServerHost')
                        ->willReturn('example.com');
 
-               $expected = new Http\RedirectResponse('nc://MyLoginName:MyGeneratedToken@example.com');
+               $expected = new Http\RedirectResponse('nc://login/server:example.com&user:MyLoginName&password:MyGeneratedToken');
                $this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken'));
        }
 
@@ -402,7 +402,7 @@ class ClientFlowLoginControllerTest extends TestCase {
                        ->method('getServerHost')
                        ->willReturn('example.com');
 
-               $expected = new Http\RedirectResponse('nc://MyLoginName:MyGeneratedToken@example.com');
+               $expected = new Http\RedirectResponse('nc://login/server:example.com&user:MyLoginName&password:MyGeneratedToken');
                $this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken'));
        }
 }