Getter for Expiration #1747
Closed
derHodrig
started this conversation in
Ideas & Feature Requests
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since this module does not refresh automatically the token, it would be nice to have a getter on token expiration.
Idea is, to set a timeout with the
expiration - date.now() - threshold
, then callthis.$auth.refreshTokens()
. If the page refreshes the timeout is gone and needs to set again with the new date.now(). If this plugin can not handle such refreshes, it would be nice to get the token expiration dates as getters. ATM we got the tokens themselves as a getter but this is, in my opinion, a detour, since there is already a cookie with that time. Of course, we can install universal cookies and get this on our own, but I think this method is a no brainer for this Plugin since you got already the exp date in your internal methods (https://github.com/nuxt-community/auth-module/blob/dev/src/inc/token.ts)Something is strange anyways.
While
this.$auth.strategy.token.status()
is an observer which does not change unless I call that method again. It would be obvious, that this observer would change if the expiration date of the token or the Plugin Exp is in the past... but this is not the case. (Cookies are all set correctly with the time of the token). Imao this must be a bug...Whats your opinion?
Beta Was this translation helpful? Give feedback.
All reactions