Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

maicol07's avatar

JWT: Can't login via web, but only via API

Hi, I've configured the tymon/jwt-auth package but I can't login via web (with laravel auth) but only via API. I've already added to my LoginController the guard type:

/**
     * Get the guard to be used during authentication.
     *
     * @return StatefulGuard
     */
    protected function guard(): StatefulGuard
    {
        return Auth::guard('web');
    }

But Web Auth still doesn't work. Can you help me? Thanks

0 likes
1 reply
bugsysha's avatar

I would advise to switch to Laravel Sanctum.

Please or to participate in this conversation.