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

Issue with multiple models using otp strategy #86

Closed
paweld-iRonin opened this issue Jul 26, 2024 · 7 comments
Closed

Issue with multiple models using otp strategy #86

paweld-iRonin opened this issue Jul 26, 2024 · 7 comments

Comments

@paweld-iRonin
Copy link

Hello 👋

I ran into an issue with the setup, where I had two models using the strategy. The first one is User and the second one is Admin. When I'm using Admin, after setting up the QR code I'm redirected to the path for User - the redirection is initiated here: https://github.com/wmlele/devise-otp/blob/master/app/controllers/devise_otp/devise/otp_tokens_controller.rb#L36 - I think this issue exists because the redirection is not scoped for the current resource. Can we fix it quickly or it's more complex change?

@strouptl
Copy link
Collaborator

Hi @paweld-iRonin, thanks for the heads up! The scope should be set automatically by the devise controller, but there could be a route conflict, or something else going on that I am not aware of.

Is there any way you could post a copy of your routes file? I will see what I can do from my side, as well.

@strouptl
Copy link
Collaborator

OK, I see what is going on - my admin and user routes are just separated by subdomain, so there is no conflict in my application. Let me see what I can do.

@paweld-iRonin
Copy link
Author

@strouptl thank you!

@paweld-iRonin
Copy link
Author

Hello @strouptl any news on this?

@strouptl
Copy link
Collaborator

Hi @paweld-iRonin, thank you for your patience. I have a simple fix ready for you, and am submitting a PR now.

@paweld-iRonin
Copy link
Author

@strouptl I really appreciate your help, thank you

@strouptl
Copy link
Collaborator

My pleasure! Thanks for bringing it to our attention.

@strzibny strzibny closed this as completed Sep 4, 2024
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

No branches or pull requests

3 participants