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

Rails 7 redirection error due to allow_other_host option not being true #140

Closed
bcasci opened this issue Jun 4, 2023 · 3 comments
Closed

Comments

@bcasci
Copy link
Contributor

bcasci commented Jun 4, 2023

I'm working with a multi-tenant app, and there is a need move users between subdomains. The app running with Rails 7. There is a redirect_to call in the passwordless source that does not use the allow_other_host option, which throw an errors when using Rails 7 because that option is defaulted to false

My proposal, which I can do if the solution is agreed upon, is to allow the passwordless configuration *_redirect_path setting to take a Proc, in addition to a string. This way the host application could provide a bit more specificity about how a redirection should function.

What do you think? Is there a better solution?

@bcasci
Copy link
Contributor Author

bcasci commented Jun 6, 2023

@mikker what do you think about this idea?

@mikker
Copy link
Owner

mikker commented Jun 6, 2023

Sounds okay 👍 PR welcome

@bcasci
Copy link
Contributor Author

bcasci commented Jun 7, 2023

@mikker After taking a closer look at the source code, and seeing how I'm the only person to raise this issue, I think it might be best to keep things simple by adding the following config setting.

mattr_accessor(:redirect_to_response_options) { {} }

This would make it so the host application could easily specify redirect_to options like allow_other_host or status if need be.

I'll probably noodle on this today.

What I proposed is fine, but it's probably overkill unless others start facing similar or more complex redirection issues.

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

2 participants