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

variant of expiry check helpers that exposes remaining time? #23

Closed
robx opened this issue Sep 16, 2019 · 1 comment
Closed

variant of expiry check helpers that exposes remaining time? #23

robx opened this issue Sep 16, 2019 · 1 comment

Comments

@robx
Copy link
Contributor

robx commented Sep 16, 2019

I'd like to check not just whether a token is expired, but whether it's close to expiry. To that extent, an API like the following would be great (which would easily allow implementing the current specialized functions):

getTokenExpirationMillis : String -> Result JwtError Int
getTokenExpirationMillis = ...

getTokenTimeToExpirationMillis : String -> Task JwtError Int
getTokenTimeToExpirationMillis = ...

What do you think? I'd be happy to provide a PR if you think this is a good idea.

@simonh1000
Copy link
Owner

I'd welcome a PR for getTokenExpirationMillis but I think the latter should be left to users

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

No branches or pull requests

2 participants