Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 799 Vote(s) - 3.57 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Missing argument 1 for Illuminate\Auth\AuthManager::createDriver() lumen and JWT

#1
I am trying to implement JWT token in my API using `Lumen + JWT`. I am using this [JWT Library][1], I have set up it, but when I want to validate passed using `JWTAuth::attempt($credentials)` I get next error

ErrorException in AuthManager.php line 16:
Missing argument 1 for Illuminate\Auth\AuthManager::createDriver(), called in /home/admin/web/mkopilka.ru/public_html/api/referral/vendor/illuminate/support/Manager.php on line 87 and defined

I know where is the problem, but cannot figure out how to solve it because I don't know internals of framework well.

I have question about how does JWT authenticate the user (checks credentials in database, as I can gues it uses model class provided in `jwt.php` with the following line `'user' => 'App\Models\User'`

By default `'user' => 'App\User'`

So even if I changed user model in this file I got the next error

vendor/illuminate/auth/EloquentUserProvider.php line 126:
Class '\App\User' not found

I thought and decided to add config/auth.php file with succeeding content

<?php

return [
'model' => 'App\Models\User'
];

And now I get the the first exception.

What is wrong I can quess that I have overridden all parameters in auth config file.

Aslo I wonder where can I find (except source code, it will take a lot of time to understand it) explanation how `JWTAuth::attempt` works ?

Thanks.

[1]:

[To see links please register here]

Reply

#2
Just had same issue myself and stumbled upon this question.

Solution is to add `'driver' => 'eloquent'` into your created **auth.php** file.
Reply

#3
I had the same problem on my upgrade from Laravel 4.1 to 4.2 (I think mainly because I updated all the files and tried to make a composer update *afterwards*).

For me the following worked (like reverting the relevant update steps):

1. Modify auth.php
==================

Add driver, model and table to config/auth.php main array (*additionally* to the already existing one in the providers sub array):

<?php

return [

'driver' => 'eloquent',
'model' => App\User::class,
'table' => 'users',

// ...

2. Add ArtisanServiceProvider
=============================

To prevent the error **Artisan: Command clear-compiled is not defined** readd `Illuminate\Foundation\Providers\ArtisanServiceProvider` to the service providers

<?php

return [

// ...

'providers' => [

/*
* Laravel Framework Service Providers...
*/
Illuminate\Foundation\Providers\ArtisanServiceProvider::class,

// ...

3. Update and revert changes
============================

Perform update (`composer update`) and revert the two previous steps by removing the added lines.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through