Respect
196
2
Laravel

Hello Friends Larvel Jwt Login Error

Posted 2 months ago by Respect

// Laravel 5.7 tymon/Jwt packge v 1.0.0 working Local but dosent work on products // When Login Cradentials correct


"message": "Argument 1 passed to Tymon\JWTAuth\JWTGuard::login() must be an instance of Tymon\JWTAuth\Contracts\JWTSubject, instance of App\User given, called in /home/k77h3iqxlvo5/public_html/shop.marvelstore.me/marvelstore/vendor/tymon/jwt-auth/src/JWTGuard.php on line 127",
"exception": "Symfony\Component\Debug\Exception\FatalThrowableError",
"file": "/home/k77h3iqxlvo5/public_html/shop.marvelstore.me/marvelstore/vendor/tymon/jwt-auth/src/JWTGuard.php",
"line": 140,

Login function look like 
public function login(Request $request)
    {
        $credentials = request(['email', 'password']);
        if (! $token = auth()->guard('api')->attempt($credentials)) {
            return response()->json(['error' => 'Wrong Username Or Password'], 401);
        }

Please sign in or create an account to participate in this conversation.