Esempio n. 1
0
 /**
  * Display the password reset view for the given token.
  *
  * @param  string  $token
  * @return \Illuminate\Http\Response
  */
 public function getConfirm($token = null)
 {
     if (is_null($token)) {
         throw new NotFoundHttpException();
     }
     $credentials = ['token' => $token];
     $response = Confirmation::confirm($credentials, function ($user) {
         $this->confirmAccount($user);
     });
     switch ($response) {
         case Confirmation::ACCOUNT_CONFIRMATION:
             return redirect($this->redirectPath())->with('status', trans($response));
         default:
             return redirect()->back()->withErrors(['email' => trans($response)]);
     }
 }
Esempio n. 2
0
 /**
  * Display the password reset view for the given token.
  *
  * @param  string  $token
  * @return \Illuminate\Http\Response
  */
 public function getConfirm($token = null)
 {
     if (is_null($token)) {
         return responseJsonNotFound(['message' => trans(Confirmation::NULL_TOKEN), 'errors' => trans(Confirmation::NULL_TOKEN)]);
     }
     $credentials = ['token' => $token];
     $response = Confirmation::confirm($credentials, function ($user) {
         $this->confirmAccount($user);
     });
     switch ($response) {
         case Confirmation::ACCOUNT_CONFIRMATION:
             return responseJsonOk(['message' => trans($response), 'data' => null]);
         default:
             return responseJsonUnprocessableEntity(['message' => trans($response), 'errors' => ['email' => trans($response)]]);
     }
 }