dingo / dingo/api

Not getting the Refresed token in error responses using the RefreshToken middleware

Open
#1,470 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
9.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

| Q | A
| ----------------- | ---
| Bug? | yes
| New Feature? | no
| Framework | Laravel
| Framework version | 5.4.36
| Package version | 1.0.x@dev
| PHP version | 7.0.1-1

#### Actual Behaviour

I have set up the RefreshToken middleware by adding the` 'jwt.refresh' => 'Tymon\JWTAuth\Middleware\RefreshToken'` to the Kernel.php and I'm currently recieving the refreshed token after each successful request. The problem is that on error responses (such as the one handled with the HTTPException helper class provided by Dingo Api), the token is not included in the response.

#### Expected Behaviour

I expected getting the same header I recieve in the successful request (with the authorization set to the refreshed token).

#### Steps to Reproduce

Once included the 'jwt.refresh' => 'Tymon\JWTAuth\Middleware\RefreshToken' to the Kernel.php file, send any error or HttpException and the `Authorization : Bearer {token}` header won't be present in the response.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.