Esempio n. 1
0
 /**
  * Process an activation attempt.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function activate()
 {
     $code = $this->input('activation_code');
     try {
         $this->users->activateByCode($code);
         return $this->success();
     } catch (ActivationException $e) {
         if ($this->debug) {
             throw $e;
         }
         return $this->error(['activation failed']);
     }
 }
Esempio n. 2
0
 /**
  * Process an activation attempt.
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function activate()
 {
     $code = $this->input('activation_code');
     try {
         $this->users->activateByCode($code);
         $msg = Lang::get('c::auth.activation-success');
         return $this->redirect('login')->with('success', $msg);
     } catch (ActivationException $e) {
         if ($this->debug) {
             throw $e;
         }
         return $this->redirect('login')->with('error', Lang::get('c::auth.activation-failed'));
     }
 }