2016-04-03 82 views
1

密碼重置時出現嚴重問題。 所有工作正常,直到我發送電子郵件密碼重置。 我已經改變了postEmail()功能如下:Laravel 5.1:密碼重置帖子返回空白頁

public function postEmail(Request $request) 
 
    { 
 
     $this->validate($request, ['email' => 'required|email']); 
 

 

 
     $response = Password::sendResetLink($request->only('email'), function (Message $message) { 
 
      $message->subject($this->getEmailSubject()); 
 
     }); 
 

 
     switch ($response) { 
 
      case Password::RESET_LINK_SENT: 
 
       return redirect('/'); 
 

 
      case Password::INVALID_USER: 
 
       return redirect()->back()->withErrors(['email' => trans($response)]); 
 
     } 
 

 
    }

但無論我嘗試,我總是收到空白頁 - 像重定向不工作在所有... E-mail傳送正確,但沒有重定向操作。

任何想法可能出錯?

回答

0

switch語句沒有默認情況。函數的結尾已經到達,沒有重定向或響應被返回,這意味着Laravel將爲其生成一個空白頁面。