-
Notifications
You must be signed in to change notification settings - Fork 229
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
Should Sorcery rename redirect_back_or_to? #296
Comments
Hmm. Yeah, that'll require some thought. The most robust solution would probably be to namespace the method, but that wouldn't be backwards compatible. Could dynamically define it based on what version of rails is defined, but I prefer avoiding that when possible just because it introduces non-trivial amounts of complexity. Thanks for bringing this up. Rails 7 has a lot of nice additions, so I want to support it as soon as possible. I'm currently knee deep in both a personal and work project, but I'll tackle Rails 7 myself after those are both settled. In the meantime, any Rails 7 related issues that can be fixed in a backwards compatible way I'll do my best to merge in quickly. |
FYI I am using this workaround for the time being: # config/initializers/sorcery_workaround_for_redirect_back_or_to.rb
module Sorcery
module Controller
module InstanceMethods
define_method :sorcery_redirect_back_or_to, instance_method(:redirect_back_or_to)
remove_method :redirect_back_or_to
end
end
end And then use Maybe sorcery could hook into rails' mechanism by just favoring |
A good way to solve this is to define another method with same functionality (something like |
Bump 🙏 I went down a bit of a debugging rabbit hole due to this naming conflict |
I got this error in production today, strange that in my development workspace is calling the rails redirect_back_or_to in and in production the sorcery one. Is there anyone looking to handle this problem? |
That is weird; a loading race condition or something to do with production preloading, perhaps? I like @lorenzk's suggestion as a solution for the v0 codebase; if someone would be willing to open a PR implementing that solution, I can merge it and push a release. |
Fix Sorcery#296 `redirect_back_or_to` defined by Rails 7 conflict by name with Sorcery's 'redirect_back_or_to'. This commit adds an option to rename this method to 'redirect_to_before_login_path'. ref: Sorcery#296 (comment)
Fix Sorcery#296 `redirect_back_or_to` defined by Rails 7 conflict by name with Sorcery's 'redirect_back_or_to'. This commit adds an option to rename this method to 'redirect_to_before_login_path'. ref: Sorcery#296 (comment)
Fix Sorcery#296 `redirect_back_or_to` defined by Rails 7 conflict by name with Sorcery's 'redirect_back_or_to'. This commit adds an option to rename this method to 'redirect_to_before_login_path'. ref: Sorcery#296 (comment)
Fix Sorcery#296 `redirect_back_or_to` defined by Rails 7 conflict by name with Sorcery's 'redirect_back_or_to'. This commit adds an option to set whether to override Sorcery's 'redirect_back_or_to' by Rails 7's 'redirect_back_or_to'. ref: Sorcery#296 (comment)
…conflicts Fix: Sorcery#296 Rails 7 released a new method called `redirect_back_or_to` as a replacement for `redirect_back`. That may conflicts with the method by the same name defined by Sorcery. This commit adds an option to set whether to use `redirect_back_or_to` defined by Rails 7, and the method `redirect_to_before_login_path` as an alternative to sorcery's `redirect_back_or_to. ref: rails/rails#40671
…conflicts 'redirect_back_or_to' Fix: Sorcery#296 Rails 7 released a new method called `redirect_back_or_to` as a replacement for `redirect_back`. That may conflicts with the method by the same name defined by Sorcery. This commit adds an option to set whether to use `redirect_back_or_to` defined by Rails 7, and add the method `redirect_to_before_login_path` as an alternative to sorcery's `redirect_back_or_to. ref: rails/rails#40671
…conflicts 'redirect_back_or_to' Fix: Sorcery#296 Rails 7 released a new method called `redirect_back_or_to` as a replacement for `redirect_back`. That may conflicts with the method by the same name defined by Sorcery. This commit adds an option to set whether to use `redirect_back_or_to` defined by Rails 7, and add the method `redirect_to_before_login_path` as an alternative to sorcery's `redirect_back_or_to. ref: rails/rails#40671
Rails 7 released a new method called
redirect_back_or_to
added by DHH as a replacement for the now soft-deprecatedredirect_back
: rails/rails#40671.That may conflict with the method by the same name defined by Sorcery. Should it be renamed? I'm opening an issue instead of a PR because I guess it's not a trivial decision to make.
The text was updated successfully, but these errors were encountered: