I have the same problem. When I attempt im not getting a reply. Only a 500 Error.
May 28, 2015
13
Level 1
Lumen Auth::attempt does not work
Hey, i tried to make an Auth system in Lumen. I have implements the Authenticatable Contract to my User Model. The users table is set.
My env:
AUTH_DRIVER=ELOQUENT
AUTH_MODEL=USER
AUTH_TABLE=USERS
SESSION_DRIVER=file
The Auth::check() method works, but the Auth::attempts() not. I became an 500 error, without more infos :(
My User Model:
<?php
namespace App;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
class User extends Model implements Authenticatable {
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier()
{
// TODO: Implement getAuthIdentifier() method.
}
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword()
{
// TODO: Implement getAuthPassword() method.
}
/**
* Get the token value for the "remember me" session.
*
* @return string
*/
public function getRememberToken()
{
// TODO: Implement getRememberToken() method.
}
/**
* Set the token value for the "remember me" session.
*
* @param string $value
*
* @return void
*/
public function setRememberToken($value)
{
// TODO: Implement setRememberToken() method.
}
/**
* Get the column name for the "remember me" token.
*
* @return string
*/
public function getRememberTokenName()
{
// TODO: Implement getRememberTokenName() method.
}}
I dont have any methods on work, is this required?
The middlewares are all active.
And this is my try:
if( ! Auth::attempt(Request::all())) { ... }
The Request::all() return an array with username and password.
Please or to participate in this conversation.