2017-02-02 156 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')