-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Redirect back if not authorized #192
Redirect back if not authorized #192
Conversation
0e2de4a
to
6556de3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kennyadsl thank you 👍
6556de3
to
e12636e
Compare
@kennyadsl is this okay to merge? |
Not yet, with @jarednorman we found a way to avoid the major bump after this PR, see solidusio/solidus#3118 (comment) |
4e5a2dc
to
3a639e0
Compare
@spaghetticode @aldesantis can you review again here, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kennyadsl thanks for the detailed explanation in the commit 👍
I noticed that the deprecation warning is emitted also on old versions that do not have the preference yet. Going to push a fix for that. |
3a639e0
to
10df4ee
Compare
Only when the `redirect_back_on_unauthorized` preference exists and is set to true. This preference has been introduced in core with solidusio/solidus#3118 and we can rely on that preference to drive the behavior change here as well. The extra if Spree::Config.respond_to?(:redirect_back_on_unauthorized) check might seem useless but it's needed to avoid printing this deprecation warning on Solidus versions that still do not have the preference. If the Solidus verion used does not have the preference yet, the old behavior will be preserved.
10df4ee
to
ff57ff5
Compare
This is a continuation of solidusio/solidus#3118 and tries to redirect back when there's an authentication error.
After this is merged I think we can safely merge the one in core as well.I updated this PR in order to use the preference introduced by the above core PR. Now the new behavior will be only supported on newer versions of Solidus, if that preference will be explicitly changed.