tymondesigns / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
https://jwt-auth.com
MIT License
11.24k stars 1.55k forks source link

QUESTION: How to get a refresh token along with an access token #2175

Open Renison-Gohel opened 2 years ago

Renison-Gohel commented 2 years ago

QUESTION: How to get a refresh token along with an access token

| Bug? | yes | New Feature? | yes | Framework | Laravel | Framework version | 8.0.0 | Package version | 1.8.2 | PHP version | 7.0.0

**How to implement refresh token like this:

  1. when login return access_token and refresh_token
  2. when access_token expires, return a message that informs the token was expired.
  3. after expired, request a new token by sending refresh_token
  4. then return new access_token with new refresh_token too.**

I'm using laravel 8 and from your documentation, the AuthController only return access_token how to generate refresh_token with TTL_REFRESH ?

GunarajKhatri commented 2 years ago

i request you to go through this my blog once ,few months back i have implemented something like above you mention. here you go

eznix86 commented 4 months ago

https://github.com/tymondesigns/jwt-auth/issues/2241