2014-09-05 49 views

回答

0

您正在運行的身份驗證過濾器供應因此必須進行檢查,如果用戶登錄,如果他們沒有,他們將被重定向到登錄頁面聚光燈路線之前。

在登錄路線,你需要改變這一點:

return Redirect::intended('/'); 

這樣:

return Redirect::intended('/spotlight'); 

這個現在應該登錄後重定向到聚光燈路線。

+0

仍然不起作用 – Phelippe 2014-09-05 11:22:50

+0

哪部分不工作? – 2014-09-05 11:24:54

+0

登錄後不重定向 – Phelippe 2014-09-05 11:35:39

0

嘗試

Redirect::route('spotlight'); 

,並創建一個路由

Route::get("/spotlight", array("as" => "spotlight", "uses" => "[email protected]"); 
0

請重新寫你的 '登陸' 的路線如下。根據您當前的邏輯,無論身份驗證是否成功,您都會再次出現「登錄」頁面;你必須有一個else條款,以便login頁面僅重新加載且僅當驗證失敗

Route::post('/login', function() 
{ 
    $credentials = Input::only('username', 'password'); 
    if (Auth::attempt($credentials)) { 
     return Redirect::intended('/'); 
    } 
    else 
    { 
     return Redirect::to('login'); 
    } 
});