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

Allow string only TwoFactorProcessor URLs #89

Closed
LordSimal opened this issue Jul 13, 2024 · 2 comments · May be fixed by #98
Closed

Allow string only TwoFactorProcessor URLs #89

LordSimal opened this issue Jul 13, 2024 · 2 comments · May be fixed by #98
Assignees

Comments

@LordSimal
Copy link
Contributor

LordSimal commented Jul 13, 2024

It would be nice if the TwoFactorMiddleware would allow string only verify urls as well like this:

    'OneTimePasswordAuthenticator' => [
        'login' => true,
        'verifyAction' => '/verify',
    ],

Currently, it requires an array syntax for URLs which only works if the Router is preloaded with the routes via the RoutingMiddleware.

But I need this so that I can move the RoutingMiddleware AFTER both Auth middlewares and show nice error messages as a logged in user if someone tries to access an unknown URL (but still show them their personalized e.g. menu or header icons)

  • CakePHP 5.1 RC1
  • CakeDC/Users 14.2.1
  • CakeDC/Auth 10.0.0
@ajibarra
Copy link
Member

@LordSimal Thanks for suggesting this. Do you think you can take a look to issue/89 branch and test your use case? I did some tests in local and it is working as suggested but another look is always welcome.

@steinkel
Copy link
Member

closed per #98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants