public function postReset(Request $request)
 {
     $params = $request->only('email', 'password', 'password_confirmation', 'token');
     $filter = $this->validator($params);
     if ($filter->fails()) {
         //            return $this->responseAnswer(true, NULL, trans('rest.14'), 14, $filter->errors());
         return view('admin.reset')->with(['token' => $params['token'], 'message' => trans('auth.failed'), 'email' => $params['email'], 'error' => $filter->errors()->toArray()]);
     }
     $response = Password::reset($params, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             //                $this->data = [
             //                            'authenticated' => true,
             //                            'role' => Auth::user()->isAdmin ? 'admin' : 'user',
             //                        ];
             //                return $this->responseAnswer(false, $this->data, trans($response));
             return redirect('/');
         default:
             //                $this->data = [
             //                            'email' => $params['email'],
             //                            'token' => $params['token'],
             //                            'authenticated' => false,
             //                            'role' => 'guest',
             //                        ];
             //                return $this->responseAnswer(true, NULL, trans($response), 1);
             return view('admin.reset')->with(['token' => $params['token'], 'message' => $response, 'email' => $params['email']]);
     }
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     if ($response == Password::PASSWORD_RESET) {
         return response()->json(["msg" => "Success", "data" => true], 200);
     } else {
         return response()->json(["msg" => "Unknown error", "data" => $response], 400);
     }
 }
 /**
  * Reset the given user's password.
  * 
  * @param  ResetPasswordRequest  $request
  * @return Response
  */
 public function postReset(ResetPasswordRequest $request)
 {
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect()->to('/')->with('ok', trans('passwords.reset'));
         default:
             return redirect()->back()->with('error', trans($response))->withInput($request->only('email'));
     }
 }
 /**
  * @param ResetPasswordRequest $request
  * @return $this|\Illuminate\Http\RedirectResponse
  */
 public function reset(ResetPasswordRequest $request)
 {
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect($this->redirectPath())->with('status', trans($response));
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response)]);
     }
 }
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect()->route('auth.password_reminder.getEmail')->with('status', trans($response));
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response)]);
     }
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect(config('backend.backend.base_url') . '/dashboard');
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response)]);
     }
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect()->route('basecamp::login');
         default:
             abort(500, 'Invalid operation (User / Password / Token).');
     }
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return new JsonResponse([], 200);
         default:
             return new JsonResponse(['error' => trans($response)], 422);
     }
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'password' => 'required|confirmed|min:6|max:16']);
     $credentials = $request->only('password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect()->back()->with('successReset', [1]);
         default:
             return redirect()->back()->withErrors(['token' => trans($response)]);
     }
 }
Exemple #10
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function reset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect('login')->with('status', trans($response))->with('success', 'Your password has been reset, you can now log in.');
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response)])->with('error', 'An error has occured, please try again.');
     }
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function doReset(ResetPasswordRequest $request)
 {
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = bcrypt($password);
         $user->save();
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return $this->simpleArray(['message' => 'Se ha actualizado su contraseña.']);
         default:
             throw new ResourceException('No hemos podido restaurar su contraseña, verifique la información enviada.');
     }
 }
Exemple #12
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|min:8|confirmed'], ['email.required' => 'Sähköpostiosoite vaaditaan varmuuden vuoksi.', 'email.email' => 'Annettu sähköpostiosoite ei ole pätevä.', 'password.required' => 'Salasana puuttuu.', 'password.min' => 'Salasanan pitää olla vähintään :min merkkiä pitkä.', 'password.confirmed' => 'Salasanat eivät täsmää.']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect($this->redirectPath())->with('status', trans($response));
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response)]);
     }
 }
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             /* customization: set 'flash_message' session var instead of 'status' */
             return redirect($this->redirectPath())->with('flash_message', trans($response));
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response)]);
     }
 }
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $credentials['department_id'] = $this->getDepartment()->id;
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect($this->redirectPath())->with('success', 'password-changed');
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response)]);
     }
 }
 /**
  * Reset the given user's password.
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function reset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = $password;
         $user->save();
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             Session::flash('message', ['type' => 'success', 'content' => trans('user::account.change_password_success')]);
             return redirect(route('auth.login'));
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response), 'msg' => trans($response)]);
     }
 }
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             Flash::success('Password successfully reset. You can now login.');
             return redirect()->route(config('authcluster.login_name_space') . '.login');
         default:
             $response = $this->getResponseMessage($response);
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => $response]);
     }
 }
 /**
  * Reset the given user's password.
  * Overwritten function of ResetsPassword trait.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return mixed
  */
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|min:6']);
     $credentials = $request->only('email', 'password', 'token');
     // confirmation value is used by Password::reset
     $credentials['password_confirmation'] = $credentials['password'];
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::INVALID_USER:
             return response()->json(['email' => [trans($response)]], 422);
         case Password::INVALID_TOKEN:
             return response()->json(['token' => [trans($response)]], 422);
     }
 }
 public function changePassword($request)
 {
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = $password;
         $user->save();
     });
     switch ($response) {
         case Password::INVALID_PASSWORD:
         case Password::INVALID_TOKEN:
         case Password::INVALID_USER:
             return redirect()->back()->with('status', trans($response));
         case Password::PASSWORD_RESET:
             return redirect()->route('home.index')->with('status', 'Senha alterada!');
     }
 }
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             Session::flash('message', 'You have successfully changed your password!');
             Session::flash('message-type', 'success');
             return redirect($this->redirectPath())->with('status', trans($response));
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response)]);
     }
 }
 /**
  * Handle a POST request to reset a user's password.
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postReset()
 {
     $credentials = Input::only(['email', 'password', 'password_confirmation', 'token']);
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = Hash::make($password);
         $user->save();
     });
     switch ($response) {
         case Password::INVALID_PASSWORD:
         case Password::INVALID_TOKEN:
         case Password::INVALID_USER:
             return Redirect::back()->with('error', Lang::get($response));
         case Password::PASSWORD_RESET:
             return Redirect::to('login')->with('password_reset', true);
     }
 }
 /**
  * Handle a POST request to reset a user's password.
  *
  * @return Response
  */
 public function postReset()
 {
     $credentials = Input::only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = $password;
         $user->save();
     });
     switch ($response) {
         case Password::INVALID_PASSWORD:
         case Password::INVALID_TOKEN:
         case Password::INVALID_USER:
             return Response::json($this->growlMessage(Lang::get($response)), 'error');
         case Password::PASSWORD_RESET:
             return Response::json($this->growlMessage('Password changed successfully.', 'success'));
     }
 }
Exemple #22
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request $request
  * @return \Illuminate\Http\Response
  */
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             Flash::success('重置成功!');
             return redirect($this->redirectPath());
         default:
             Flash::error('密码重置失败!');
             return redirect()->back()->withInput($request->only('email'));
     }
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postReset(Request $request)
 {
     $validator = Validator::make($request->all(), ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     if ($validator->fails()) {
         return response()->json($validator->getMessageBag()->toArray(), 422);
     }
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return response()->json($response);
         default:
             return response()->json(['email' => $response], 422);
     }
 }
Exemple #24
0
 public function postReset(Request $request)
 {
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $filter = $this->validator($credentials);
     if ($filter->fails()) {
         return view('auth.reset', ['token' => $credentials['token'], 'error' => $filter->errors()->toArray()]);
     }
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect('admin');
         default:
             return view('auth.reset', ['email' => $credentials['email'], 'token' => $credentials['token'], 'message' => trans($response)]);
     }
 }
 public function anyPassword(Request $request)
 {
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $validator = Validator::make($credentials, ['email' => 'required|email|max:255', 'password' => 'required|confirmed|min:6', 'token' => 'required']);
     if ($validator->fails()) {
         return response()->json($validator->messages())->setStatusCode(412, 'Invalid Passwords');
     }
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = bcrypt($password);
         $user->save();
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return response()->json('Password successfuly reset!');
         default:
             return response()->json(trans($response))->setStatusCode(412, 'Invalid Passwords');
     }
 }
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     $flag = Staff::where('email', $request->email)->get()->first();
     if ($flag->active == 0) {
         return redirect()->back()->with('message', 'Account is not active!');
     }
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect($this->redirectPath())->with('status', trans($response));
         default:
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => trans($response)]);
     }
 }
 /**
  * Reset password
  *
  * @param  Request $request
  * @return json
  */
 public function reset(Request $request)
 {
     $validator = Validator::make($request->all(), ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     if ($validator->fails()) {
         return response()->json($validator->errors(), 400);
     }
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
         // @codeCoverageIgnore
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return response()->json(null, 200);
         default:
             return response()->json(null, 400);
     }
 }
 public function reset(Request $request)
 {
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $validator = Validator::make($credentials, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6']);
     if ($validator->fails()) {
         throw new ValidationHttpException($validator->errors()->all());
     }
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = $password;
         $user->save();
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             if (Config::get('boilerplate.reset_token_release')) {
                 return $this->login($request);
             }
             return $this->response->noContent();
         default:
             return $this->response->error('could_not_reset_password', 500);
     }
 }
 /**
  * Ustawienie nowego hasla i ponowne logowanie uzytkownika
  *
  * @param Request $request
  * @return $this|\Illuminate\Http\RedirectResponse
  */
 public function postReset(Request $request)
 {
     $this->validate($request, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:3']);
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     // walidacja poprawnosci hasla. jedyne wymaganie to posiadanie hasla max 3 znakowego
     Password::validator(function (array $credentials) {
         return true;
     });
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = bcrypt($password);
         $user->save();
         Auth::login($user);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return redirect(route('home'))->with('success', 'Hasło zostało prawidłowo ustawione');
         default:
             $errors = [Password::INVALID_USER => 'Podany adres e-mail nie jest przypisany do żadnego konta', Password::INVALID_TOKEN => 'URL jest nieprawidłowy. Być może ten link nie jest już aktywny?'];
             return redirect()->back()->withInput($request->only('email'))->withErrors(['email' => $errors[$response]]);
     }
 }
 /**
  * Handle a POST request to reset a user's password.
  *
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse|null
  */
 public function postReset(Request $request)
 {
     $credentials = $request->only('email', 'password', 'password_confirmation', 'token');
     $validator = app('Illuminate\\Contracts\\Validation\\Factory')->make($credentials, ['token' => 'required', 'email' => 'required|email', 'password' => 'required|min:8']);
     if ($validator->fails()) {
         throw new FormValidationException('Error', $validator->errors());
     }
     //We aren't using a confirm password box so this can be faked
     $credentials['password_confirmation'] = $credentials['password'];
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = $password;
         $user->save();
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             \Notification::success("Your password has been changed");
             return redirect()->home();
         default:
             \Notification::error(trans($response));
             return redirect()->back()->withInput();
     }
 }