tymondesigns/jwt-auth · error · Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException

User not found

Error message

User not found

What it means

Error "User not found" thrown in tymondesigns/jwt-auth.

Source

Thrown at src/Http/Middleware/BaseMiddleware.php:69

            throw new UnauthorizedHttpException('jwt-auth', 'Token not provided');
        }
    }

    /**
     * Attempt to authenticate a user via the token in the request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return void
     *
     * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException
     */
    public function authenticate(Request $request)
    {
        $this->checkForToken($request);

        try {
            if (! $this->auth->parseToken()->authenticate()) {
                throw new UnauthorizedHttpException('jwt-auth', 'User not found');
            }
        } catch (JWTException $e) {
            throw new UnauthorizedHttpException('jwt-auth', $e->getMessage(), $e, $e->getCode());
        }
    }

    /**
     * Set the authentication header.
     *
     * @param  \Illuminate\Http\Response|\Illuminate\Http\JsonResponse  $response
     * @param  string|null  $token
     * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
     */
    protected function setAuthenticationHeader($response, $token = null)
    {
        $token = $token ?: $this->auth->refresh();
        $response->headers->set('Authorization', 'Bearer '.$token);

View on GitHub (pinned to 6c70930a92)

When it happens

Trigger: Thrown at src/Http/Middleware/BaseMiddleware.php:69 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tymondesigns/jwt-auth@6c70930a92 (2026-08-21). Data as JSON: /api/errors/a629cb57e45209e8. Report an issue: GitHub.