2017-02-02 154 views
0

一旦我的用户在登录时被验证,他们被点击此警告无效的用户凭据,请再试一次!我不知道如何解决这个问题!验证:验证后无法登录

if (Auth::attempt(['email' => $request->email, 'password' => $request->pass], true)) { 

     return redirect()->intended('dashboard'); 
    } 

我的用户表 -

public function up() { 
    Schema::create('users', function (Blueprint $table) { 
     $table->increments('id'); 
     $table->string('name'); 
     $table->string('email')->unique(); 
     $table->string('password' , 64); 
     $table->tinyInteger('verified')->default(0); // this column will be a TINYINT with a default value of 0 , [0 for false & 1 for true i.e. verified] 
     $table->string('email_token')->nullable(); // this column will be a VARCHAR with no default value and will also BE NULLABLE 
     $table->rememberToken(); 
     $table->timestamps(); 
    }); 
} 
+0

'$ request-> pass'是否被散列? – Siliace

+0

你是什么意思? –

+0

@DeadRespawn密码是否与数据库中的bcrypt一起散列?如果你创建一个用户,你应该使用'bcrypt($ yourpassword)'函数来散列用户密码。尝试函数需要在数据库中加密密码。 –

回答

0

正如Siliace说,密码必须bcrypted。 您可以通过检查:如果你看到

dd($request->input('pass')); 

你键入的内容 - 你需要bcrypt($request->input('pass'));

我不知道,但我觉得你有$请求是请求的实例。 因此,对输入字段的访问是:$request->input('email')$request->input('pass')