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

Token not provided

Error message

Token not provided

What it means

Error "Token not provided" thrown in tymondesigns/jwt-auth.

Source

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

     * @return void
     */
    public function __construct(JWTAuth $auth)
    {
        $this->auth = $auth;
    }

    /**
     * Check the request for the presence of a token.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return void
     *
     * @throws \Symfony\Component\HttpKernel\Exception\BadRequestHttpException
     */
    public function checkForToken(Request $request)
    {
        if (! $this->auth->parser()->setRequest($request)->hasToken()) {
            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');

View on GitHub (pinned to 6c70930a92)

When it happens

Trigger: Thrown at src/Http/Middleware/BaseMiddleware.php:51 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/ec6b8d8e4ade39fb. Report an issue: GitHub.