Update login flow redirection
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
fb3ac32915
commit
e4aac15a92
3 changed files with 7 additions and 6 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue