Expire user session when access token expires - #112
Draft
Naokimi wants to merge 1 commit into
Draft
Conversation
|
|
||
| private | ||
|
|
||
| def session_refreshed_or_expired? |
Contributor
There was a problem hiding this comment.
Considering we are not refreshing the access_token anymore, maybe it will be better to rename it to write_access_token_expired? or something like this.
| def before_delivery | ||
| if session_refreshed_or_expired? | ||
| Spree::UserLastUrlStorer.new(self).store_location | ||
| sign_out(spree_current_user) |
Contributor
There was a problem hiding this comment.
Don't require redirecting the user to sign_out page? 🤔
Contributor
Author
There was a problem hiding this comment.
when I tested it it redirected automatically
Naokimi
force-pushed
the
expire-user-session-when-access_token-expires
branch
from
June 21, 2022 02:02
03b7a9a to
57a97b7
Compare
In a previous commit we setup to have the AddAddressesToBolt be called asynchronously via a Job. However, when the first access_token expires then new one doesn't have write access anymore so the Job fails. To solve this we are adding a check for the expiration time and signing out the user, to force them to get a fresh token with write access. To improve the UX, we are moving this step to before delivery (to avoid signing out a user right at the end of the checkout flow).
Naokimi
force-pushed
the
expire-user-session-when-access_token-expires
branch
from
June 21, 2022 02:02
57a97b7 to
dd9b5a5
Compare
|
This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a previous commit we setup to have the AddAddressesToBolt be called
asynchronously via a Job. However, when the first access_token expires
then new one doesn't have write access anymore so the Job fails. To
solve this we are adding a check for the expiration time and signing out
the user, to force them to get a fresh token with write access.
To improve the UX, we are moving this step to before delivery (to avoid
signing out a user right at the end of the checkout flow).
Requires nebulab/omniauth-bolt#5