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

Fix issue with scoped redirects for non-default resources #88

Merged
merged 3 commits into from
Aug 15, 2024

Conversation

strouptl
Copy link
Collaborator

@paweld-iRonin discovered an issue (#86) where the non-default resource was being redirected to the default resource's routes within the otp_tokens_controller. The underlying problem is that simply calling "redirect_to :show" in the otp_tokens_controller redirects to the default scope, rather than getting the proper scope for that resource.

This issue is a hold over from before, when we were only using one resource, and it was not reflected in tests, as the user scope is the default anyway. However, it can be reproduced by reversing the order of the "devise_for" additions for users and admins in the routes file of the test app.

This PR resolves the immediate issue, along with the attendant "Disable OTP" link issue.

…edirected to properly scoped path (rather than the default scope);
@strouptl
Copy link
Collaborator Author

@strzibny, I made one more commit, reversing the order of the admin and user routes in the test app. This will eliminate false positives in the tests from the default (user) routes like this going forward.

@strzibny strzibny merged commit 626f156 into wmlele:master Aug 15, 2024
1 check passed
@strzibny
Copy link
Collaborator

Thank you!

@strouptl strouptl deleted the scoped_redirects_fix branch November 19, 2024 17:25
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 this pull request may close these issues.

2 participants