tymondesigns / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
https://jwt-auth.com
MIT License
11.23k stars 1.55k forks source link

Followed the Laravel installation and quick start, getting error: "Tymon\\JWTAuth\\JWTGuard::login(): Argument #1 ($user) must be of type Tymon\\JWTAuth\\Contracts\\JWTSubject #2237

Open teckel12 opened 5 months ago

teckel12 commented 5 months ago

Subject of the issue

Followed the Laravel installation and quick start, getting the error:

500 Internal Server Error

To clarify, I do have the following in the Users.php model: class User extends Authenticatable implements JWTSubject

Your environment

Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 9.19
Package version ?
PHP version 8.0.30

Steps to reproduce

  1. Instal Laravel
  2. Connected to DB
  3. Created user table
  4. Follow the jwt-auth Laravel installation and quick start
  5. Attempt to sign on
  6. Get the above error

Expected behaviour

Return the reponse:

{
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ",
    "token_type": "bearer",
    "expires_in": 3600
}

Actual behaviour

500 error as outlined above