i use laravel tymon/jwt-auth for jwt authentication. but when i authenticate, just get access token, not refresh token
in package.json
{
...
"require": {
"php": "^7.1.3",
"barryvdh/laravel-cors": "^0.11.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"tymon/jwt-auth": "dev-develop"
}
...
}
i expect to get an refresh token to refresh the token after expiration, in the config/jwt.php i can set the expiration time for both access token and refresh token, but i can't get it. how to get the refresh token ?
First, go your project directory Open the terminal or CMD inside your project directory and execute the below command
$ php artisan route:list
it will give you all the routes regarding your project including the auth routes, inside that route list you can see a route like this
POST | api/auth/refresh
you should send the POST request to the above route with by providing the expired access token inside the header or body as Bearer token. It will return the new token as the response.
Note: if the previous access token is not expired after calling the refresh token, endpoint previous token will be automatically expired.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With