All passport features works, passport is installed correct. The problem is somewhere where Laravel and Passport is connecting I guess, As I can't validate user's credentials upon login action. Validate is asking for request, if I am passing the incoming parameter request, validate method returns only true.
class AuthController extends Controller
{
public function login(Request $request)
{
$login = $request->only(['username', 'password']);
dd(Auth::validate($login));
}
}
error:
Undefined index: request in file D:\oms\api\vendor\laravel\framework\src\Illuminate\Auth\RequestGuard.php on line 71
config/auth.php
'defaults' => [
'guard' => 'api',
'passwords' => 'users',
],
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport',
'provider' => 'users',
'hash' => false,
],
],
class User extends Authenticatable
{
use HasApiTokens,
protected $fillable = [
'username',
'password',
];
}
Please, any tought will be fine :)
request
element? – miken32Illuminate\Foundation\Auth\AuthenticatesUsers
trait. You shouldn't need to do this manually. – miken32request
to method, it returns always true; – Mike