-
Notifications
You must be signed in to change notification settings - Fork 13
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
[FEATURE REQUEST] - Check for expired token #71
Comments
Yes, you are correct, this plugin do not check expiracy or validity of the token. You could add in options something like this: fetchData: {
url: '/auth/user',
method: 'GET',
interval: 30,
enabled: true,
}, This will fetch user info at |
Thanks, @d0whc3r. I can work with that for now. Maybe, as a future requirement you could have separate options for userInfo and for refreshToken. I think a lot of API's will usually separate those endpoints. Thanks again for the quick response! |
@d0whc3r ... I have used your suggestion, and here's an extract from my config: fetchData: {
url: '/auth/me',
method: 'GET',
interval: 5,
enabled: true
} The After 5 minutes I can see the |
It looks like the |
No, only the user is updated in fetchData, if you need to update the token, you need to login again |
Ok, I decided to implement refresh method #80 once it passes the pipeline I will merge it, also documentation was extended to reflect this change 😄 |
version 1.1.4 was published and it includes refresh option, check documentation to know how it works |
Legend! Thanks, @d0whc3r! I can work with this! I am going to log another feature request to include a separate refresh token - will add detail to the issue. |
Added feature request #82. |
Firstly ... I really enjoy the simplicity of this plugin!! Quick and easy to use!
From what I can see,
$auth.check()
currently only checks for the existence of the token in storage.Tokens may expire after a period time. In this scenario, if one clicks on a route (just an example) that requires auth, the check will pass because the token is in localstorage, but when a request is sent to the API, a
401
is returned.So, it would be great if the
$auth.check()
could include a check for expiry - maybe using theexp
from the token?The text was updated successfully, but these errors were encountered: