Postgresql 这些凭证与我们的记录不符,laravel 5.2
我正在使用laravel auth并通过DB种子插入管理员用户,我还加密了密码,对于“记住令牌”,我没有碰过它。在DB(postgre)中,用户被添加了加密密码和空白的Memory_令牌,但当我尝试登录时,它显示“这些凭据与我们的记录不匹配” 如果我注册并从注册和登录页面登录,它工作得非常好 这是我在播种机中的跑步记录->Postgresql 这些凭证与我们的记录不符,laravel 5.2,postgresql,authentication,laravel-5.2,Postgresql,Authentication,Laravel 5.2,我正在使用laravel auth并通过DB种子插入管理员用户,我还加密了密码,对于“记住令牌”,我没有碰过它。在DB(postgre)中,用户被添加了加密密码和空白的Memory_令牌,但当我尝试登录时,它显示“这些凭据与我们的记录不匹配” 如果我注册并从注册和登录页面登录,它工作得非常好 这是我在播种机中的跑步记录-> public function run() { DB::table ( 'users' )->insert ( array ( 'nam
public function run()
{
DB::table ( 'users' )->insert ( array (
'name' => 'Test',
'email' => 'test@gmail.com',
'password'=>bcrypt('test'),
'created_at'=>new DateTime(),
'updated_at'=>new DateTime(),
) );
DB::table ( 'users' )->insert ( array (
'name' => 'Demo',
'email' => 'demo@gmail.com',
'password'=>bcrypt('demo'),
'created_at'=>new DateTime(),
'updated_at'=>new DateTime(),
) );
}
我建议您在用户模型中定义密码加密
/**
* setPasswordAttribute
* @param void
*/
public function setPasswordAttribute($value)
{
$this->attributes['password'] = bcrypt($value);
}
我建议您在用户模型中定义密码加密
/**
* setPasswordAttribute
* @param void
*/
public function setPasswordAttribute($value)
{
$this->attributes['password'] = bcrypt($value);
}
您正在使用postLogin功能吗?对不起,我不明白,是哪个postLogin功能。但我使用的登录表单与laravel提供的make:AuthWhat密码加密方式相同。你在用bcrypt吗?你能给我看看db seeder吗?嘿@Dean我已经用seeder更新了我的问题。你在使用postLogin功能吗?对不起,我不明白,哪个postLogin功能。但我使用的登录表单与laravel提供的make:AuthWhat密码加密方式相同。你在用bcrypt吗?你能给我看看db seeder吗?嘿@Dean我已经用seeder更新了我的问题。