Uh oh!
There was an error while loading. Please reload this page.
Do not do redirect handling when loggin out - #12573
Conversation
nickvergessen
commented
Nov 22, 2018
I dislike this patch a bit, because if you are on a page which is publicly accessible, it loads that page, instead of redirecting to the login form. In my head the following should have worked: publicfunction showLoginForm(string$user = null, string$redirect_url = null): Http\Response {
if ($this->session->exists('clearingExecutionContexts')) {
$this->session->remove('clearingExecutionContexts');
$response = newRedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
$response->addHeader('Clear-Site-Data', '"cache", "storage", "executionContexts"');
return$response;
}But while your request is on |
rullzer
commented
Nov 22, 2018
Do you have a logout button on a public page? |
nickvergessen
commented
Nov 22, 2018
Well on Talk the same URL is used for a room independent of your login state. |
MorrisJobke
commented
Feb 1, 2019
@rullzer@nickvergessen What is the status here? Continue it or close it? |
rullzer
commented
Feb 4, 2019
Let me have another look. I might have a more elegant way |
rullzer
commented
Feb 4, 2019
@nickvergessen can you verify that this seems fixed with the latest firefox? |
rakekniven
commented
Feb 5, 2019
No, it is still the same with ff 65. |
nickvergessen
commented
Feb 5, 2019
Same here, still broken with FF 65.0 |
9e1061d to
689adc8Comparerullzer
commented
Feb 5, 2019
Ok this is now a bit more elegant I think. @nickvergessen please check it out |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fixes#12568 Since the clearing of the execution context causes another reload. We should not do the redirect_uri handling as this results in redirecting back to the logout page on login. This adds a simple middleware that will just check if the ClearExecutionContext session variable is set. If that is the case it will just redirect back to the login page. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
689adc8 to
60e5a5eCompareMorrisJobke
commented
Feb 6, 2019
Backport? |
rullzer
commented
Feb 6, 2019
Fine by me. It is mainly an added middleware. So should not cause issues. |
MorrisJobke
commented
Feb 14, 2019
/backport to stable15 |
The backport to stable15 failed. Please do this backport manually. |
See https://github.com/nextcloud/server/blob/b085803c0bfe8c568e5710525e49d5f6378833b6/core/Controller/LoginController.php#L99 and following lines. Also note that setting `clearingExecutionContexts` is no longer required, because it had to do with the executionContexts feature which is no longer used by nextcloud since nextcloud/server#16310. Furthermore, with the behavior introduced in nextcloud/server#12573, setting `clearingExecutionContexts` breaks our logout redirects, because the middleware subsequently (after the logout redirect) returns another redirects to `/login?clear=1`.
See https://github.com/nextcloud/server/blob/b085803c0bfe8c568e5710525e49d5f6378833b6/core/Controller/LoginController.php#L99 and following lines. Also note that setting `clearingExecutionContexts` is no longer required, because it had to do with the executionContexts feature which is no longer used by nextcloud since nextcloud/server#16310. Furthermore, with the behavior introduced in nextcloud/server#12573, setting `clearingExecutionContexts` breaks our logout redirects, because the middleware subsequently (after the logout redirect) returns another redirects to `/login?clear=1`.
Fixes#12568
Since the clearing of the execution context causes another reload. We
should not do the redirect_uri handling as this results in redirecting
back to the logout page on login.
Signed-off-by: Roeland Jago Douma roeland@famdouma.nl