joselfonseca / lighthouse-graphql-passport-auth

Add GraphQL mutations to get tokens from passport for https://lighthouse-php.com/
https://lighthouse-php-auth.com/
MIT License
228 stars 56 forks source link

RefreshToken Required lcobucci / jwt #136

Closed Fitmavincent closed 3 years ago

Fitmavincent commented 3 years ago

Problem:

Error calling RefreshToken mutation

My Investigation

This lighthouse-graphql-passport-auth requires lcobucci/jwt package. But there's no indication or prerequisite stated a composer install of lcobucci/jwt.

Suggested solution:

  1. Either stated the pre install requirement of this package, or automated the process during composer install
  2. If the package pre install requirement is not required, then please address the issue of "Class 'Lcobucci\\JWT\\Configuration' not found" when calling refreshToken mutation.

Stack trace

trace": [
        {
          "file": "/var/www/vendor/joselfonseca/lighthouse-graphql-passport-auth/src/GraphQL/Mutations/RefreshToken.php",
          "line": 36,
joselfonseca commented 3 years ago

Hello, thank you for the issue.

So the dependency is pulled in by Passport

https://github.com/laravel/passport/blob/10.x/composer.json#L30

Can you provide more info on what versions for Passport and this package you have installed? This may be that the version installed does not have the method since it may have been added in a more recent version. I would like to have that information to trace a possible issue or not.

Thank you!

Fitmavincent commented 3 years ago

Hi Jose, if you don't mind I call you Jose,

My laravel/passport is in version 10. But I can see my lcobucci/jwt is in 3.0

Thank you.

Fitmavincent commented 3 years ago

Alright Jose,

I think I need to do a manual upgrade on the passport then. It might be good to update the documents regarding the laravel/passport version.

My laravel/passport doesn't include the lcobucci/jwt in version 10.0

    "require": {
        "php": "^7.3",
        "ext-json": "*",
        "firebase/php-jwt": "^5.0",
        "illuminate/auth": "^8.2",
        "illuminate/console": "^8.2",
        "illuminate/container": "^8.2",
        "illuminate/contracts": "^8.2",
        "illuminate/cookie": "^8.2",
        "illuminate/database": "^8.2",
        "illuminate/encryption": "^8.2",
        "illuminate/http": "^8.2",
        "illuminate/support": "^8.2",
        "league/oauth2-server": "^8.1",
        "nyholm/psr7": "^1.3",
        "phpseclib/phpseclib": "^2.0",
        "symfony/psr-http-message-bridge": "^2.0"
    },
deatil commented 3 years ago

Alright Jose,

I think I need to do a manual upgrade on the passport then. It might be good to update the documents regarding the laravel/passport version.

My laravel/passport doesn't include the lcobucci/jwt in version 10.0

    "require": {
        "php": "^7.3",
        "ext-json": "*",
        "firebase/php-jwt": "^5.0",
        "illuminate/auth": "^8.2",
        "illuminate/console": "^8.2",
        "illuminate/container": "^8.2",
        "illuminate/contracts": "^8.2",
        "illuminate/cookie": "^8.2",
        "illuminate/database": "^8.2",
        "illuminate/encryption": "^8.2",
        "illuminate/http": "^8.2",
        "illuminate/support": "^8.2",
        "league/oauth2-server": "^8.1",
        "nyholm/psr7": "^1.3",
        "phpseclib/phpseclib": "^2.0",
        "symfony/psr-http-message-bridge": "^2.0"
    },

The league/oauth2-server use lcobucci/jwt.

Fitmavincent commented 3 years ago

Alright Jose, I think I need to do a manual upgrade on the passport then. It might be good to update the documents regarding the laravel/passport version. My laravel/passport doesn't include the lcobucci/jwt in version 10.0

    "require": {
        "php": "^7.3",
        "ext-json": "*",
        "firebase/php-jwt": "^5.0",
        "illuminate/auth": "^8.2",
        "illuminate/console": "^8.2",
        "illuminate/container": "^8.2",
        "illuminate/contracts": "^8.2",
        "illuminate/cookie": "^8.2",
        "illuminate/database": "^8.2",
        "illuminate/encryption": "^8.2",
        "illuminate/http": "^8.2",
        "illuminate/support": "^8.2",
        "league/oauth2-server": "^8.1",
        "nyholm/psr7": "^1.3",
        "phpseclib/phpseclib": "^2.0",
        "symfony/psr-http-message-bridge": "^2.0"
    },

The league/oauth2-server use lcobucci/jwt.

Hmm, I've tried composer install multiple times and lcobucci/jwt didn't get updated. Anyway, I've updated manually and solved the problem.