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

Add expired? method to check if session is expired #1244

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

gbzodek
Copy link
Contributor

@gbzodek gbzodek commented Nov 23, 2023

Description

What is the problem it is solving?

There isn't currently a method available to check if an auth session is expired (for online tokens mainly). It's up to each app to implement the method if they want to do such check. This PR adds an expired? method to the Session that will check the expires attribute if it exists.

What is the context of these changes?

We are planning to add a check on the expiry date in shopify_app to trigger an early re-auth, and having that method will make the check cleaner

What is the impact of this PR?

A new method can be used to check if the session is expired. No impact as long as it's not used

How has this been tested?

Unit tests provided in the PR

Checklist:

  • My commit message follow the pattern described in here
  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the project documentation.
  • I have added a changelog line.

@gbzodek gbzodek self-assigned this Nov 23, 2023
@gbzodek gbzodek force-pushed the session-expired-method branch from 5f24210 to aa6a151 Compare November 23, 2023 15:21
@gbzodek gbzodek requested a review from calirvine November 23, 2023 15:23
@gbzodek gbzodek marked this pull request as ready for review November 23, 2023 15:58
@gbzodek gbzodek requested a review from a team as a code owner November 23, 2023 15:58
Copy link
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks!

@gbzodek gbzodek merged commit 459b04e into main Nov 24, 2023
7 checks passed
@gbzodek gbzodek deleted the session-expired-method branch November 24, 2023 08:37
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

Successfully merging this pull request may close these issues.

2 participants