2016-04-19 1 views
0

Das in meinen RoutenMiddleware verweist nicht auf der Seite auf Erfolg Auth attempt.Using Laravel 5.2 und Mongo DB

Route::post('companyLogin','Auth\[email protected]'); 


Route::group(['middleware' => 'auth'], function() { 

Route::get('dashboard',['uses' => '[email protected]' , 'as' => 'dashboard']); 

}); 

Das ist mein Controller:

<?php 

namespace App\Http\Controllers\Auth; 

use App\User; 

use Validator; 

use App\Http\Controllers\Controller; 

use Illuminate\Foundation\Auth\ThrottlesLogins; 

use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; 

use Illuminate\Support\Facades\Input; 

use Illuminate\Support\Facades\Redirect; 

use Illuminate\Support\Facades\Request; 

use Illuminate\Support\Facades\Auth; 

use View; 

class AuthController extends Controller 

{ 

public function companyLogin() 

    { 

     $userdata = array(

      'email' => Input::get('email'), 

      'password' =>Input::get('password')); 

     $isAuth = Auth::attempt($userdata); 

     if($isAuth) 
     { 

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

     } else {   

      return view('login'); 

     } 
    } 
} 
+0

einzuloggen Umleitung wird Seite gehen melden Sie sich erneut –

+0

ja, es geht zurück zum Login –

Antwort

0

Kann Ihre Anmeldeinformationen sind falsch .

->i mean did you bcrypted the password and saved in the database. 
->if you not bcrypted the password,then you must bcrypt the password and save in database. 
->Auth::attemptbcrypt the password and then checks 

Beispiel:

$userdata = array(

      'email' => '[email protected]', 

      'password' =>'yahoo'; 

     $isAuth = Auth::attempt($userdata); 

Auth :: Versuch bcrypts das yahoo Passwort und prüft in der Datenbank und gibt false zurück, so dass es