-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Expire user session when access token expires #112
base: main
Are you sure you want to change the base?
Conversation
|
||
private | ||
|
||
def session_refreshed_or_expired? |
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.
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.
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.
fixed in 57a97b7
def before_delivery | ||
if session_refreshed_or_expired? | ||
Spree::UserLastUrlStorer.new(self).store_location | ||
sign_out(spree_current_user) |
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.
Don't require redirecting the user to sign_out page? 🤔
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.
when I tested it it redirected automatically
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).
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. |
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