Giter VIP home page Giter VIP logo

laravel-mongodb-passport's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-mongodb-passport's Issues

jenssegers/mongodb 3.6 not supported required 3.5.* error

Problem 1

designmynight/laravel-mongodb-passport v1.2.7 requires jenssegers/mongodb 3.3.* || 3.4.* || 3.5.* -> satisfiable by jenssegers/mongodb[v3.3.0, v3.3.0-alpha, v3.3.1, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.5.0, v3.5.1, v3.5.2, v3.5.3] but these conflict with your requirements or minimum-stability.

        "php": "^7.2",
        "fideloper/proxy": "^4.0",
        "jenssegers/mongodb": "^3.6",
        "laravel/framework": "^6.2",
        "laravel/tinker": "^2.0",
        "league/fractal": "^0.18.0",
        "prettus/l5-repository": "^2.6",
        "robclancy/presenter": "^1.4"
    }

Support Passport 9

A new passport version 9 has been released. It would be great if this package could use the latest version as well.

Database [users] not configured. After revoke or token expired

Hi.
I really helped you make this package, but right now I have a problem when I revoke the token, or when the token has expired. I get the error message "Database [users] not configured."

please help me, my client is waiting and I'm stuck here. This is my code

'mongodb' => [ 'driver' => 'mongodb', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', 27017), 'database' => env('DB_DATABASE'), 'username' => env('DB_USERNAME'), 'password' => env('DB_PASSWORD'), 'options' => [ 'database' => 'users' ] ],

`public function logout(Request $request)
{
$request->user()->token()->revoke();

    return response()->json([
        'message' => 'Logout successfully'
    ], 200);
}`

Not working with laravel 5.6 and Jenssegers Mongodb

When I am trying to generate token for a user (oath/token), it always say invalid clientid, it is not able to pick _id as id, when I am adding a field id with the same value in the "oauth_clients" collection it works.
Please suggest.

abandoned (?)

more than a year that this package is not updated, then i forked it, made it compatible with latest laravel and passport versions then published it under my namespace.

Pls have a look at hypnodev/laravel-mongodb-passport.

Compatibility with jenssegers/mongodb 3.6

Are there plans to upgrade the package to make it compatible with jenssegers/mongodb 3.6. Currently getting this message when installing on Laravel 6

designmynight/laravel-mongodb-passport v1.2.7 requires jenssegers/mongodb 3.3.* || 3.4.* || 3.5.* -> satisfiable by jenssegers/mongodb[v3.3.0, v3.3.0-alpha, v3.3.1, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.5.0, v3.5.1, v3.5.2, v3.5.3] but these conflict with your requirements or minimum-stability

Call to a member function beginTransaction() on null in file laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php on line 108

I'm using Laravel 5.6 and Passport 7.0 with Jenssengers MongoDB.
Installation of passport when very well, including migrations.
Every collection exists.
I have two records in oauth_clients collections.
I have created a new user in users collection.

Trying to login my user through oauth/token, generate this error:
Call to a member function beginTransaction() on null in file laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php on line 108

Any advice?

Compatibility with jenssegers/mongodb 4.0.0-alpha.1

Is there any update for jenssegers/mongodb 4.0.0-alpha.1 version? Because Laravel 7 only support v4.0.0-alpha.1. When I tried to install this package with version 2.0.1, it gives error like:

Problem 1 - Can only install one of: jenssegers/mongodb[3.6.x-dev, 4.0.0-alpha.1]. - Can only install one of: jenssegers/mongodb[4.0.0-alpha.1, 3.6.x-dev]. - designmynight/laravel-mongodb-passport v2.0.1 requires jenssegers/mongodb 3.3.* || 3.4.* || 3.5.* || 3.6.* -> satisfiable by jenssegers/mongodb[3.6.x-dev]. - Installation request for designmynight/laravel-mongodb-passport ^2.0.1 -> satisfiable by designmynight/laravel-mongodb-passport[v2.0.1]. - Installation request for jenssegers/mongodb 4.0.0-alpha.1 -> satisfiable by jenssegers/mongodb[4.0.0-alpha.1].

Hopefully this package will supports v4 soon!

Password grant client

Hello, I'm developing a little app on Laravel with VueJs and MongoDB. I'm trying to figure out how to generate new password grant clients, but it seems impossible since the only way that I see to do so is using the command line php artisan passport:client --password. As long as I know, the command line of passport isn't compatible with this package.

I'm pretty sure that there is a way to use grant clients, what did I missed ?

Error when try make request to endpoint /oauth/token

BadMethodCallException: Call to undefined method DesignMyNight\Mongodb\Passport\Client::confidential() in file C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php on line 50

#0 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php(36): Illuminate\Database\Eloquent\Model::throwBadMethodCallException('confidential')
#1 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(1618): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Jenssegers\Mongodb\Eloquent\Builder), 'confidential', Array)
#2 C:\xampp\htdocs\apirealtrends\vendor\jenssegers\mongodb\src\Jenssegers\Mongodb\Eloquent\Model.php(480): Illuminate\Database\Eloquent\Model->__call('confidential', Array)
#3 C:\xampp\htdocs\apirealtrends\vendor\laravel\passport\src\Bridge\ClientRepository.php(58): Jenssegers\Mongodb\Eloquent\Model->__call('confidential', Array)
#4 C:\xampp\htdocs\apirealtrends\vendor\league\oauth2-server\src\Grant\AbstractGrant.php(182): Laravel\Passport\Bridge\ClientRepository->validateClient('5e1a12356838000...', 'mqX2aTZaiQEu8wf...', 'password')
#5 C:\xampp\htdocs\apirealtrends\vendor\league\oauth2-server\src\Grant\PasswordGrant.php(52): League\OAuth2\Server\Grant\AbstractGrant->validateClient(Object(Laminas\Diactoros\ServerRequest))
#6 C:\xampp\htdocs\apirealtrends\vendor\league\oauth2-server\src\AuthorizationServer.php(198): League\OAuth2\Server\Grant\PasswordGrant->respondToAccessTokenRequest(Object(Laminas\Diactoros\ServerRequest), Object(League\OAuth2\Server\ResponseTypes\BearerTokenResponse), Object(DateInterval))
#7 C:\xampp\htdocs\apirealtrends\vendor\laravel\passport\src\Http\Controllers\AccessTokenController.php(63): League\OAuth2\Server\AuthorizationServer->respondToAccessTokenRequest(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Diactoros\Response))
#8 C:\xampp\htdocs\apirealtrends\vendor\laravel\passport\src\Http\Controllers\HandlesOAuthErrors.php(24): Laravel\Passport\Http\Controllers\AccessTokenController->Laravel\Passport\Http\Controllers{closure}()
#9 C:\xampp\htdocs\apirealtrends\vendor\laravel\passport\src\Http\Controllers\AccessTokenController.php(65): Laravel\Passport\Http\Controllers\AccessTokenController->withErrorHandling(Object(Closure))
#10 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(48): Laravel\Passport\Http\Controllers\AccessTokenController->issueToken(Object(Laminas\Diactoros\ServerRequest))
#11 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Routing\Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Laravel\Passport\Http\Controllers\AccessTokenController), 'issueToken')
#12 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Routing\Route.php(176): Illuminate\Routing\Route->runController()
#13 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Routing\Router.php(681): Illuminate\Routing\Route->run()
#14 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(130): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#15 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Routing\Middleware\ThrottleRequests.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#16 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure))
#17 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#18 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Routing\Router.php(683): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#19 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Routing\Router.php(658): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#20 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Routing\Router.php(624): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#21 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Routing\Router.php(613): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#22 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(170): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#23 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
#24 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#25 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#27 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#29 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#30 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#31 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#32 C:\xampp\htdocs\apirealtrends\vendor\fideloper\proxy\src\TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#33 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#34 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#35 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(145): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#36 C:\xampp\htdocs\apirealtrends\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#37 C:\xampp\htdocs\apirealtrends\public\index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#38 {main}

BadMethodCallException "Client::confidential()"

I'm getting this error, and I didn't understand why
Call to undefined method DesignMyNight\\Mongodb\\Passport\\Client::confidential()
Knowing that I'm using MongoDB as a database

I sent a POST request with this header and body:
Header:
Content-Type:application/json Accept:application/json
Body:
{ "email": "[email protected]", "password": "123456" }

My Controller function :

public function login(Request $request)
   {
       $request->validate([
           'email' => 'required|email',
           'password' => 'required|min:6'
       ]);
       if(Auth::attempt(["email" => $request->email, "password" => $request->password])){
           $user = Auth::user();
           $token = $user->createToken($user->email."-".now());
           $token = $token->accessToken;
           return response()->json([
               "token" => $token
           ]);
       }
   }

My composer.json file:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2",
        "designmynight/laravel-mongodb-passport": "^1.2",
        "fideloper/proxy": "^4.0",
        "jenssegers/mongodb": "^3.6",
        "laravel/framework": "^6.2",
        "laravel/tinker": "^2.0"
    },
    "require-dev": {
        "facade/ignition": "^1.4",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^8.0"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

My User Model:

<?php

namespace App;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use DesignMyNight\Mongodb\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Passport\HasApiTokens;

class User extends Authenticatable
{
    use Notifiable, HasApiTokens;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}

The Return:

{
    "message": "Call to undefined method DesignMyNight\\Mongodb\\Passport\\Client::confidential()",
    "exception": "BadMethodCallException",
    "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php",
    "line": 50,
    "trace": [
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php",
            "line": 36,
            "function": "throwBadMethodCallException",
            "class": "Illuminate\\Database\\Eloquent\\Model",
            "type": "::"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",
            "line": 1620,
            "function": "forwardCallTo",
            "class": "Illuminate\\Database\\Eloquent\\Model",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Eloquent/Model.php",
            "line": 480,
            "function": "__call",
            "class": "Illuminate\\Database\\Eloquent\\Model",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/passport/src/Bridge/ClientRepository.php",
            "line": 78,
            "function": "__call",
            "class": "Jenssegers\\Mongodb\\Eloquent\\Model",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/passport/src/Bridge/ClientRepository.php",
            "line": 54,
            "function": "handlesGrant",
            "class": "Laravel\\Passport\\Bridge\\ClientRepository",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/league/oauth2-server/src/Grant/AbstractGrant.php",
            "line": 182,
            "function": "validateClient",
            "class": "Laravel\\Passport\\Bridge\\ClientRepository",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/passport/src/Bridge/PersonalAccessGrant.php",
            "line": 21,
            "function": "validateClient",
            "class": "League\\OAuth2\\Server\\Grant\\AbstractGrant",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/league/oauth2-server/src/AuthorizationServer.php",
            "line": 198,
            "function": "respondToAccessTokenRequest",
            "class": "Laravel\\Passport\\Bridge\\PersonalAccessGrant",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/passport/src/PersonalAccessTokenFactory.php",
            "line": 114,
            "function": "respondToAccessTokenRequest",
            "class": "League\\OAuth2\\Server\\AuthorizationServer",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/passport/src/PersonalAccessTokenFactory.php",
            "line": 71,
            "function": "dispatchRequestToAuthorizationServer",
            "class": "Laravel\\Passport\\PersonalAccessTokenFactory",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/passport/src/HasApiTokens.php",
            "line": 67,
            "function": "make",
            "class": "Laravel\\Passport\\PersonalAccessTokenFactory",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/app/Http/Controllers/AuthController.php",
            "line": 48,
            "function": "createToken",
            "class": "App\\User",
            "type": "->"
        },
        {
            "function": "login",
            "class": "App\\Http\\Controllers\\AuthController",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
            "line": 54,
            "function": "call_user_func_array"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
            "line": 45,
            "function": "callAction",
            "class": "Illuminate\\Routing\\Controller",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
            "line": 219,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\ControllerDispatcher",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
            "line": 176,
            "function": "runController",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 681,
            "function": "run",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 130,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
            "line": 41,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 59,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 105,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 683,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 658,
            "function": "runRouteWithinStack",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 624,
            "function": "runRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 613,
            "function": "dispatchToRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 170,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 130,
            "function": "Illuminate\\Foundation\\Http\\{closure}",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
            "line": 27,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php",
            "line": 63,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/fideloper/proxy/src/TrustProxies.php",
            "line": 57,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Fideloper\\Proxy\\TrustProxies",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 105,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 145,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 110,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/public/index.php",
            "line": 55,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/home/ixi/Desktop/TuniSales/Dev/v1.0.0/server.php",
            "line": 21,
            "function": "require_once"
        }
    ]
}

Call to a member function prepare() on null during password grant token request

Package versions

  • laravel/passport: 8.4.1
  • designmynight/laravel-mongodb-passport: 1.2.9
  • jenssegers/mongodb: 3.6.3

Description

When issuing password grant tokens by /oauth/token route, the error shown in the Stack Trace Below occurs, making the token issue requests not to work as expected.

It seems that the laravel/passport package has added a RefreshToken model in its latest changes which it's not handled by the MongodbPassportServiceProvider.

I've made a fork to do it and, besides not having tested it thoroughly, it makes the route work again.

Stack Trace

Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function prepare() on null in file /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 457

#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(662): Illuminate\Database\Connection->Illuminate\Database\{closure}('insert into "oa...', Array)
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback('insert into "oa...', Array, Object(Closure))
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(464): Illuminate\Database\Connection->run('insert into "oa...', Array, Object(Closure))
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(416): Illuminate\Database\Connection->statement('insert into "oa...', Array)
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2651): Illuminate\Database\Connection->insert('insert into "oa...', Array)
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1366): Illuminate\Database\Query\Builder->insert(Array)
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(815): Illuminate\Database\Eloquent\Builder->__call('insert', Array)
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(667): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder))
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(765): Illuminate\Database\Eloquent\Model->save()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php(422): Illuminate\Database\Eloquent\Builder->Illuminate\Database\Eloquent\{closure}(Object(Laravel\Passport\RefreshToken))
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(766): tap(Object(Laravel\Passport\RefreshToken), Object(Closure))
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(23): Illuminate\Database\Eloquent\Builder->create(Array)
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1620): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), 'create', Array)
#13 /var/www/html/vendor/laravel/passport/src/RefreshTokenRepository.php(15): Illuminate\Database\Eloquent\Model->__call('create', Array)
#14 /var/www/html/vendor/laravel/passport/src/Bridge/RefreshTokenRepository.php(57): Laravel\Passport\RefreshTokenRepository->create(Array)
#15 /var/www/html/vendor/league/oauth2-server/src/Grant/AbstractGrant.php(527): Laravel\Passport\Bridge\RefreshTokenRepository->persistNewRefreshToken(Object(Laravel\Passport\Bridge\RefreshToken))
#16 /var/www/html/vendor/league/oauth2-server/src/Grant/PasswordGrant.php(65): League\OAuth2\Server\Grant\AbstractGrant->issueRefreshToken(Object(Laravel\Passport\Bridge\AccessToken))
#17 /var/www/html/vendor/league/oauth2-server/src/AuthorizationServer.php(198): League\OAuth2\Server\Grant\PasswordGrant->respondToAccessTokenRequest(Object(Nyholm\Psr7\ServerRequest), Object(League\OAuth2\Server\ResponseTypes\BearerTokenResponse), Object(DateInterval))
#18 /var/www/html/vendor/laravel/passport/src/Http/Controllers/AccessTokenController.php(63): League\OAuth2\Server\AuthorizationServer->respondToAccessTokenRequest(Object(Nyholm\Psr7\ServerRequest), Object(Laminas\Diactoros\Response))
#19 /var/www/html/vendor/laravel/passport/src/Http/Controllers/HandlesOAuthErrors.php(24): Laravel\Passport\Http\Controllers\AccessTokenController->Laravel\Passport\Http\Controllers\{closure}()
#20 /var/www/html/vendor/laravel/passport/src/Http/Controllers/AccessTokenController.php(65): Laravel\Passport\Http\Controllers\AccessTokenController->withErrorHandling(Object(Closure))
#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(48): Laravel\Passport\Http\Controllers\AccessTokenController->issueToken(Object(Nyholm\Psr7\ServerRequest))
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Laravel\Passport\Http\Controllers\AccessTokenController), 'issueToken')
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\Routing\Route->run()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(613): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

Can not install on laravel 5.8 with jenssegers/mongodb 3.5

This is error when I was trying install on Laravel 5.8.11 with jenssegers/mongodb 3.5

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - designmynight/laravel-mongodb-passport v1.1.5 requires jenssegers/mongodb 3.3.* || 3.4.* -> satisfiable by jenssegers/mongodb[v3.3.0, v3.3.0-alpha, v3.3.1, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6] but these conflict with your requirements or minimum-stability.
    - designmynight/laravel-mongodb-passport v1.1.4 requires jenssegers/mongodb 3.3.* || 3.4.* -> satisfiable by jenssegers/mongodb[v3.3.0, v3.3.0-alpha, v3.3.1, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6] but these conflict with your requirements or minimum-stability.
    - designmynight/laravel-mongodb-passport v1.1.3 requires jenssegers/mongodb 3.3.* || 3.4.* -> satisfiable by jenssegers/mongodb[v3.3.0, v3.3.0-alpha, v3.3.1, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6] but these conflict with your requirements or minimum-stability.
    - designmynight/laravel-mongodb-passport v1.1.2 requires jenssegers/mongodb 3.3.* || 3.4.* -> satisfiable by jenssegers/mongodb[v3.3.0, v3.3.0-alpha, v3.3.1, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6] but these conflict with your requirements or minimum-stability.
    - designmynight/laravel-mongodb-passport v1.1.1 requires jenssegers/mongodb 3.3.* -> satisfiable by jenssegers/mongodb[v3.3.0, v3.3.0-alpha, v3.3.1] but these conflict with your requirements or minimum-stability.
    - designmynight/laravel-mongodb-passport v1.1.0 requires jenssegers/mongodb 3.3.* -> satisfiable by jenssegers/mongodb[v3.3.0, v3.3.0-alpha, v3.3.1] but these conflict with your requirements or minimum-stability.
    - Installation request for designmynight/laravel-mongodb-passport ^1.1 -> satisfiable by designmynight/laravel-mongodb-passport[v1.1.0, v1.1.1, v1.1.2, v1.1.3, v1.1.4, v1.1.5].


Installation failed, reverting ./composer.json to its original content.

I hope owner can fix it soon.
Thank you

compatibility issues

"laravel/passport": "^10.1",
"jenssegers/mongodb": "^3.8"

after run: composer require designmynight/laravel-mongodb-passport

Problem 1
- designmynight/laravel-mongodb-passport[v2.0.0, ..., v2.0.1] require illuminate/support ^5.5 || ^6.0 -> found illuminate/support[v5.5.0, .
.., 5.8.x-dev, v6.0.0, ..., 6.x-dev] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires designmynight/laravel-mongodb-passport ^2.0 -> satisfiable by designmynight/laravel-mongodb-passport[v2.0.0,
v2.0.1].

Error when run passport:installl

I run php artisan passport:install has error
Symfony\Component\Debug\Exception\FatalThrowableError : Argument 1 passed to Laravel\Passport\Console\ClientCommand::outputClientDetails() must be an instance of Laravel\Passport\Client, instance of DesignMyNight\Mongodb\Passport\Client given, called in D:\Projects\basiganh\vendor\laravel\passport\src\Console\ClientCommand.php on line 69

        "php": "^7.2.5|^8.0",
        "designmynight/laravel-mongodb-passport": "2.0.1",
        "jenssegers/mongodb": "3.6.*",
        "fideloper/proxy": "^4.4",
        "laravel/framework": "^6.20.26",
        "laravel/passport": "8.0",
        "laravel/tinker": "^2.5",
        "laravel/ui": "1.3"
    }

Pls help me.

Request for lumen support

Its good to know having a reliable support of Passport with MongoDb for Laravel, but I'm in need of this support for Lumen for my build.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.