tymondesigns/jwt-auth · error · Tymon\JWTAuth\Exceptions\JWTException

A token is required

Error message

A token is required

What it means

Error "A token is required" thrown in tymondesigns/jwt-auth.

Source

Thrown at src/JWT.php:318

     */
    public function unsetToken()
    {
        $this->token = null;

        return $this;
    }

    /**
     * Ensure that a token is available.
     *
     * @return void
     *
     * @throws \Tymon\JWTAuth\Exceptions\JWTException
     */
    protected function requireToken()
    {
        if (! $this->token) {
            throw new JWTException('A token is required');
        }
    }

    /**
     * Set the request instance.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return $this
     */
    public function setRequest(Request $request)
    {
        $this->parser->setRequest($request);

        return $this;
    }

    /**
     * Set whether the subject should be "locked".

View on GitHub (pinned to 6c70930a92)

When it happens

Trigger: Thrown at src/JWT.php:318 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/c7a3ebf3ef3ee9b3. Report an issue: GitHub.