php验证密码后跳转_php-laravel框架用户验证(Auth)模块解析(四)忘记密码
一、忘記密碼模塊路由
二、控制器解析
跟注冊、登錄的控制器一樣,大部分的邏輯使用trait引入。
ForgotPasswordController:負責忘記密碼頁面,以及郵件發送
四、擴展開發:自定義的忘記密碼行為
忘記密碼有多種處理方式,這里默認的是通過郵件重置。現實中,還可以有通過回答預設問題、手機號等方式。
1)IlluminateFoundationAuthSendsPasswordResetEmails::sendResetLinkEmail負責郵件發送
這里,我們解析一下發送郵件的方法,并假設郵件已發送成功(實際沒有發出去)
public function sendResetLinkEmail(Request $request){$this->validateEmail($request);// We will send the password reset link to this user. Once we have attempted// to send the link, we will examine the response then see the message we// need to show to the user. Finally, we'll send out a proper response.//$response = $this->broker()->sendResetLink(// $request->only('email')//);// always true$response = Password::RESET_LINK_SENT;return $response == Password::RESET_LINK_SENT? $this->sendResetLinkResponse($request, $response): $this->sendResetLinkFailedResponse($request, $response);}2)IlluminateFoundationAuthResetsPasswords::showResetForm負責展示重置密碼頁面,reset方法負載驗證重置密碼。
以上就是php-laravel框架用戶驗證(Auth)模塊解析(二)注冊模塊的詳細內容,覺得對你有幫助記得點個關注!!
小編結合以上知識體系整理了一套BAT面試真題+架構技術資料,退可提升軟硬實力,進可收獲高薪好offer。資料內容涵蓋BAT架構技術與面試真題,減少你到處搜索資料的時間,成體系的實戰技術知識,讓你面試、進階都更加容易。
領取方式:對面試文檔總結感興趣的幫可以點下面鏈接進入石墨文檔了解大型互聯網企業面試答案獲取詳情!
PHP進階學習筆記、面試;文檔、視頻資源免費獲取?shimo.im總結
以上是生活随笔為你收集整理的php验证密码后跳转_php-laravel框架用户验证(Auth)模块解析(四)忘记密码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python git切换分支_git命令
- 下一篇: springboot test_精益求精