Exemplo n.º 1
0
 /**
  * Authenticate and Validate login input.
  *
  * @param Request $request
  *
  * @return $this|\Illuminate\Http\RedirectResponse
  */
 public function authentication(Request $request)
 {
     try {
         $this->authRepositoryInterface->authenticate($request->all());
     } catch (FormValidationException $e) {
         Flash::error($e->getMessage());
         return redirect()->route('auth.login')->withErrors($e->getErrors());
     } catch (AuthenticationException $e) {
         Flash::error($e->getMessage());
         return redirect()->route('auth.login');
     }
     return redirect()->route('dashboard.index');
 }
Exemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function updatePassword(array $data, $validate = true)
 {
     $user = $this->auth->authenticate($data);
     $this->rules = ['new_password' => 'required|confirmed', 'new_password_confirmation' => 'required'];
     if ($validate) {
         $this->validate($data);
     }
     $updatedData = ['password' => $data['new_password']];
     $this->sentinel->update($user, $updatedData);
     return;
 }