TESTING: testing authentication

This commit is contained in:
Michal Kváček
2016-01-21 02:37:40 +01:00
parent 035ba92cf5
commit 4b330fad0d
2 changed files with 10 additions and 72 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class Login extends Controller
return; return;
} }
if (Auth::attempt(['email' => $request->email, 'password' => $request->password])) { if (Auth::attempt($request->only('email', 'password'))) {
echo "prihlaseni uspesne"; echo "prihlaseni uspesne";
return; return;
+8 -70
View File
@@ -2,95 +2,33 @@
namespace App\Models; namespace App\Models;
use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticableInterface;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\Access\Authorizable;
/** /**
* Class User * Class User
*/ */
class User extends Model implements Authenticatable class User extends Model implements AuthenticableInterface
{ {
use Authenticatable, Authorizable, CanResetPassword;
public $timestamps = false; public $timestamps = false;
protected $fillable = [ protected $fillable = [
'email', 'email',
'username', 'username',
'password', 'password',
'remember_token',
'name', 'name',
'status'
]; ];
protected $guarded = []; protected $guarded = [];
/** /**
* The attributes excluded from the model's JSON form. * The attributes excluded from the model's JSON form.
* *
* @var array * @var array
*/ */
protected $hidden = [ protected $hidden = [
'password', 'remember_token', 'password',
'remember_token',
]; ];
/**
* Get the name of the unique identifier for the user.
*
* @return string
*/
public function getAuthIdentifierName()
{
return $this->email;
} }
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier()
{
return $this->id;
}
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword()
{
return $this->password;
}
/**
* Get the token value for the "remember me" session.
*
* @return string
*/
public function getRememberToken()
{
return $this->remember_token;
}
/**
* Set the token value for the "remember me" session.
*
* @param string $value
*
* @return void
*/
public function setRememberToken($value)
{
$this->remember_token = $value;
}
/**
* Get the column name for the "remember me" token.
*
* @return string
*/
public function getRememberTokenName()
{
return 'remember_token';
}}