-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(auth): Keep redirect URL during 2FA setup and challenge #44745
Conversation
/backport to stable29 |
/backport to stable28 |
/backport to stable27 |
$params = [ | ||
'redirect_url' => $this->request->getParam('redirect_url'), | ||
]; | ||
if (!isset($params['redirect_url']) && isset($this->request->server['REQUEST_URI'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still find it disturbing that isset is false when the value is null...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works.
6083dad
to
8fbd8cc
Compare
@@ -230,7 +231,7 @@ | |||
* @NoCSRFRequired | |||
*/ | |||
#[FrontpageRoute(verb: 'GET', url: 'login/setupchallenge/{providerId}')] | |||
public function setupProvider(string $providerId) { | |||
public function setupProvider(string $providerId, ?string $redirect_url = null) { |
Check notice
Code scanning / Psalm
MissingReturnType Note
@@ -264,11 +266,12 @@ | |||
* @todo handle the extreme edge case of an invalid provider ID and redirect to the provider selection page | |||
*/ | |||
#[FrontpageRoute(verb: 'POST', url: 'login/setupchallenge/{providerId}')] | |||
public function confirmProviderSetup(string $providerId) { | |||
public function confirmProviderSetup(string $providerId, ?string $redirect_url = null) { |
Check notice
Code scanning / Psalm
MissingReturnType Note
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
dc9f352
to
22dc278
Compare
Summary
The redirect URL is crucial when a user is sent to Nextcloud to grant access for clients during the login flow. Without this, users will log in and land on the default page instead of the grant page for the setup.
How to test
Master: land at /apps/dashboard, /apps/files or whatever the default is
Here: land at /settings/user
TODO
Checklist