Skip to content
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

Undefined index: redirect_url at core/templates/twofactorsetupselection.php #21968

Closed
GitHubUser4234 opened this issue Jul 23, 2020 · 10 comments · Fixed by #31947
Closed

Undefined index: redirect_url at core/templates/twofactorsetupselection.php #21968

GitHubUser4234 opened this issue Jul 23, 2020 · 10 comments · Fixed by #31947
Labels
1. to develop Accepted and waiting to be taken care of bug

Comments

@GitHubUser4234
Copy link
Contributor

Hi,

When accessing /server/index.php/login/setupchallenge , the following error is triggered:

Undefined index: redirect_url at /xxx/core/templates/twofactorsetupselection.php#36

Setup:

  • NC 18.0.6
  • Only 1 authenticator app is installed (twofactor_totp v4.1.3)
  • 2FA globally enforced
  • Apache 2.4
  • PHP 7.4

Not sure whether it is something similar like #2854?

How could I quickly patch this manually? Thanks!

@GitHubUser4234 GitHubUser4234 added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jul 23, 2020
@kesselb
Copy link
Contributor

kesselb commented Jul 23, 2020

Index: core/templates/twofactorsetupselection.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/templates/twofactorsetupselection.php	(revision 1edd191af77e9a0ac4f4665041f862e021137f08)
+++ core/templates/twofactorsetupselection.php	(date 1595530177267)
@@ -33,7 +33,6 @@
 			   href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.setupProvider',
 								[
 									'providerId' => $provider->getId(),
-									'redirect_url' => $_['redirect_url'],
 								]
 							)) ?>">
 				<?php

A redirect url is not required for setup provider. It's also not available at this stage. I guess the above patch should fix it but never used this feature before ;)

cc @rullzer

@GitHubUser4234
Copy link
Contributor Author

Thanks @kesselb, removed the suggested line and no more errors show up.

@GitHubUser4234 GitHubUser4234 added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jul 25, 2020
@rullzer
Copy link
Member

rullzer commented Aug 13, 2020

@ChristophWurst do you remember why this is there?
Maybe we can remove it? Or else have some logic to only add it if it is set?

@sam9032
Copy link

sam9032 commented Dec 18, 2020

Thanks @kesselb. The same error occurred in my Nextcloud instance and that fixed it. Would be great to have this patch in the repo.

@solracsf
Copy link
Member

Problem remains at 21.0.1.

@AndyXheli
Copy link

Also still on 20.0.8

@AndyXheli
Copy link

AndyXheli commented Apr 24, 2021

I remove the line 'redirect_url' => $_['redirect_url'], in /var/www/nextcloud/core/templates/twofactorsetupselection.php#36 setup a new user account and configure 2FA on first logon and error is no longer there. Im sorry about the pull request i changed the wrong file. i can also confirm that this would fix the issue had no issues come up after removing the line as far as i can see

@AndyXheli
Copy link

AndyXheli commented Nov 12, 2021

any update on this ? Still an issue on 22.2.2

@sveeke
Copy link

sveeke commented Jan 24, 2022

Also an issue on a relatively fresh 23.0.0.

Undefined index: redirect_url at /usr/local/www/cloud.xxxxxx.xx/core/templates/twofactorsetupselection.php#36

@AndyXheli
Copy link

Still an issue NC 23.0.3

{"reqId":"haaLKh61xoXXv4t7erSJ","level":3,"time":"2022-04-12T14:05:11+00:00","remoteAddr":"10.0.0.1","user":"Steve","app":"PHP","method":"GET","url":"/login/setupchallenge","message":"Undefined array key "redirect_url" at /var/www/nextcloud/core/templates/twofactorsetupselection.php#36","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36","version":"23.0.3.2","exception":{"Exception":"Error","Message":"Undefined array key "redirect_url" at /var/www/nextcloud/core/templates/twofactorsetupselection.php#36","Code":0,"Trace":[{"file":"/var/www/nextcloud/core/templates/twofactorsetupselection.php","line":36,"function":"onError","class":"OC\Log\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":180,"args":["/var/www/nextcloud/core/templates/twofactorsetupselection.php"],"function":"include"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":150,"function":"load","class":"OC\Template\Base","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":179,"function":"fetchPage","class":"OC\Template\Base","type":"->"},{"file":"/var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php","line":204,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":171,"function":"render","class":"OCP\AppFramework\Http\TemplateResponse","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"6255979664931"}

@solracsf solracsf linked a pull request Apr 13, 2022 that will close this issue
backportbot-nextcloud bot pushed a commit that referenced this issue Oct 6, 2022
Signed-off-by: Andy Xheli <axheli@axtsolutions.com>

Should fix Undefined index: redirect_url at core/templates/twofactorsetupselection.php #21968
backportbot-nextcloud bot pushed a commit that referenced this issue Oct 6, 2022
Signed-off-by: Andy Xheli <axheli@axtsolutions.com>

Should fix Undefined index: redirect_url at core/templates/twofactorsetupselection.php #21968
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants