2016-09-17 10 views
1

と一致しません。私はlaravel authを使用しており、DBシーディングを通じて管理ユーザーを挿入しています。また、パスワードも暗号化しています。 DB(postgre)では、暗号化されたパスワードと空のremember_tokenがユーザーに追加されますが、ログインしようとすると「これらの資格情報は私たちのレコードと一致しません」と表示されます。これらの資格情報は私たちのレコードlaravel 5.2

登録とログインページからログインしても、それは問題なく動作します。

は、ここで私はあなたのユーザーモデルでは、パスワードの暗号化を定義することをお勧め

> seeder-
public function run() 
{ 
    DB::table ('users')->insert (array (
      'name' => 'Test', 
      'email' => '[email protected]', 
      'password'=>bcrypt('test'), 
      'created_at'=>new DateTime(), 
      'updated_at'=>new DateTime(), 
    )); 

    DB::table ('users')->insert (array (
      'name' => 'Demo', 
      'email' => '[email protected]', 
      'password'=>bcrypt('demo'), 
      'created_at'=>new DateTime(), 
      'updated_at'=>new DateTime(), 
    )); 
} 
+0

postLogin機能を使用していますか? – Dean

+0

申し訳ありませんが、どのpostLogin関数がわかりません。しかし、私が使っているログインフォームは、laravelがmakeと提供するのと同じです:auth –

+0

あなたはパスワードを暗号化する方法を教えてください。あなたはbcryptを使用していますか?あなたはdb seeder plsを表示できますか? – Dean

答えて

0

の私の実行()です。

/** 
* setPasswordAttribute 
* @param void 
*/ 
public function setPasswordAttribute($value) 
{ 
    $this->attributes['password'] = bcrypt($value); 
} 
関連する問題