Uh oh!
There was an error while loading. Please reload this page.
Conversation
Signed-off-by: Mario Danic <mario@lovelyhq.com>
| ->willReturn('example.com'); | ||
| $expected = new Http\RedirectResponse('nc://login/server:example.com&user:MyLoginName&password:MyGeneratedToken'); | ||
| $expected = new Http\RedirectResponse('nc://login/http://server:example.com&user:MyLoginName&password:MyGeneratedToken'); |
There was a problem hiding this comment.
'nc://login/server:http://cough
| ->willReturn('http://example.com'); | ||
| $expected = new Http\RedirectResponse('nc://login/server:example.com&user:MyLoginName&password:MyGeneratedToken'); | ||
| $expected = new Http\RedirectResponse('nc://login/http://server:example.com&user:MyLoginName&password:MyGeneratedToken'); |
mario
commented
Oct 19, 2017
@nickvergessen fixed |
mario
commented
Oct 19, 2017
I tested, it works, but I don't know if tests work xD |
| ->expects($this->once()) | ||
| ->method('getServerHost') | ||
| ->willReturn('example.com'); | ||
| ->willReturn('http://example.com'); |
There was a problem hiding this comment.
this is cheating? make sure it actually calls getServerProtocol ?!
There was a problem hiding this comment.
Hm actually wouldnt it return example.com? Since it's just getServerHost ... Tests need better thinking xD
Codecov Report
@@ Coverage Diff @@## master #6879 +/- ##
=========================================
Coverage ? 34.68% Complexity ? 24299 =========================================
Files ? 1577 Lines ? 92928 Branches ? 1359 =========================================
Hits ? 32235 Misses ? 60693 Partials ? 0
|
mario
commented
Oct 19, 2017
Can we get this in 12 as well? It's important ... |
mario
commented
Oct 19, 2017
@nickvergessen all should be fixed. |
rullzer
commented
Oct 19, 2017
Why do we need this? I think we should only allow the new flow with https. If that can't be then just first try https and if that fails http. Also. The user already entered an url with protocol to get to this stage. Can't you just fetch the protocol from the url entered? |
mario
commented
Oct 19, 2017
a) I don't want to guess (possible two network queries instead of one) Also, while allowing all this only with HTTPS is a noble idea, reality is different :) |
| $this->session->remove('oauth.state'); | ||
| } else { | ||
| $redirectUri = 'nc://login/server:' . $this->request->getServerHost() . '&user:' . urlencode($loginName) . '&password:' . urlencode($token); | ||
| $serverPath = $this->request->getServerProtocol() . "://" . $this->request->getServerHost() . substr($this->request->getRequestUri(), 0, strpos($this->request->getRequestUri(), "/index.php")); |
There was a problem hiding this comment.
This won't work if you have pretty urls. Since then you don't have index.php
There was a problem hiding this comment.
Do you have an alternative suggestion? Even on Android for login flow we always use index.php.
There was a problem hiding this comment.
Added support for pretty urls.
| $this->session->remove('oauth.state'); | ||
| } else { | ||
| $redirectUri = 'nc://login/server:' . $this->request->getServerHost() . '&user:' . urlencode($loginName) . '&password:' . urlencode($token); | ||
| $serverPostfix = ""; |
| $serverPostfix = substr($this->request->getRequestUri(), 0, strpos($this->request->getRequestUri(), "/login/flow")); | ||
| } | ||
| $serverPath = $this->request->getServerProtocol() . "://" . $this->request->getServerHost() . $serverPostfix; |
| $serverPostfix = ""; | ||
| if (strpos($this->request->getRequestUri(), '/index.php') !== false) { | ||
| $serverPostfix = substr($this->request->getRequestUri(), 0, strpos($this->request->getRequestUri(), "/index.php")); |
nickvergessen
commented
Nov 1, 2017
Should we merge this then? Or does it break existing stuff etc? |
mario
commented
Nov 8, 2017
@nickvergessen updated. |
MorrisJobke
commented
Nov 8, 2017
Conflict :/ |
This fixes the new authentication flow as in: