public function getResetWebsite($token = null) { $page = 'recuperar-senha'; $websiteSettings = \App\Exceptions\Handler::readFile("websiteSettings.json"); $pages = Pages::where('slug', '=', $page)->first(); $user = PasswordResets::where('token', '=', $token)->first(); if (is_null($token)) { throw new NotFoundHttpException(); } return view('website.profile.recoveryPassword')->with(compact('token', 'page', 'websiteSettings', 'pages', 'user')); }
public function postFixPassword(PasswdResetFixRequest $request) { $pr = PasswordResets::where('token', $request['token'])->where('created_at', '>', Carbon::now()->subHours($this->exp))->first(); if ($pr != null) { $u = User::findOrFail($pr->user_id); if ($u != null) { $u->update(['password' => $request['password1']]); flash()->overlay("Your password has been changed, login to access system."); PasswordResets::where('token', $request['token'])->delete(); } else { flash()->overlay("Your password change failed."); } } return redirect('/auth/login'); }