vue-authenticate icon indicating copy to clipboard operation
vue-authenticate copied to clipboard

Refresh Token

Open jonagoldman opened this issue 7 years ago • 8 comments

Most auth implementations use a short lived access token and a longer living refresh token in order to securely maintain the user logged in. Basically the refresh token is used to generate a new access token once it has expired, and this is done without having to ask the user for login credentials again. I found a detailed explanation in the vue-auth package. Does this package support this in any way?

jonagoldman avatar Apr 17 '17 17:04 jonagoldman

For now, this library does not support automatic token refresh. You can provide another token in any ajax response (means that your api would take care of token's "expired" state) (in body [headers currently not supported]) and current one will automatically be replaced (if you are using vue-resource as request library, for any other, you'll have to do it manually).

I'll have to check out possible ways of doing this and see if i'm going to implement it. Of course, any suggestion is more than welcome.

dgrubelic avatar Apr 17 '17 19:04 dgrubelic

@jonagoldman take a look at this

https://laracasts.com/discuss/channels/vue/jwt-auth-with-vue-resource-interceptor?page=1

I implemented refresh tokens using interceptors, basically check for a 401 header if so send an authorisation request before next()

nshCore avatar Jun 11 '17 18:06 nshCore

This will soon be available as an improvement. For now, I don't have a specific timeline when this will be available.

dgrubelic avatar Sep 30 '17 18:09 dgrubelic

@jkirkby91-2 any working example for this - for newcomers like me ...

rico avatar Feb 10 '18 10:02 rico

Any update about this feature?

arenasv86 avatar Feb 20 '18 16:02 arenasv86

This would be a great feature

aidanayala avatar Mar 13 '18 12:03 aidanayala

I was looking at how to do this yesterday. Having it built in would be awesome.

WayneHiller avatar Apr 09 '18 13:04 WayneHiller

+1

Andrei-Pozolotin avatar Aug 16 '19 18:08 Andrei-Pozolotin