/**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Auth::customer()->check()) {
         return redirect()->intended('customer/dashboard');
     }
     return $next($request);
 }
Esempio n. 2
0
 public function forgot_password(Form $form)
 {
     $request = $form->request->all();
     if (!Auth::customer()->forgotPassword($request['email'])) {
         $error = trans('account.alerts.wrong_password_forgot');
         Message::addError($error);
         throw new \Exception($error);
     }
     Message::addSuccess(trans('account.alerts.password_forgot'));
 }
Esempio n. 3
0
 public function forgot_password(Form $form)
 {
     $auth = Auth::customer();
     $request = $form->request->all();
     if ($auth->forgotPassword($request['email'])) {
         Message::addSuccess(trans('account.alerts.password_forgot'));
     } else {
         Message::addError(trans('account.alerts.wrong_password_forgot'));
     }
 }
Esempio n. 4
0
 protected function header()
 {
     $top_links = menu('header.links');
     $top_links->add('cart', ['href' => url('cart'), 'text' => 'Cart #' . $this->cart->id . ' - ' . $this->cart->getSummary() . ' item(s)']);
     if (Auth::customer()->check()) {
         $top_links->add('account', ['href' => url('customer/dashboard'), 'text' => 'My Account']);
         $top_links->add('logout', ['href' => url('customer/logout'), 'text' => 'Logout']);
     } else {
         $top_links->add('login', ['href' => url('customer/login'), 'text' => 'Login/Register']);
     }
 }
Esempio n. 5
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Auth::customer()->guest()) {
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             return redirect()->guest('customer/login');
         }
     }
     return $next($request);
 }
Esempio n. 6
0
 /**
  * Create a new authentication controller instance.
  */
 public function __construct()
 {
     $this->auth = Auth::customer();
     $this->middleware('guest', ['except' => 'getLogout']);
     $this->loadLayout();
 }
 /**
  * Create a new authentication controller instance.
  */
 public function __construct()
 {
     $this->auth = Auth::customer();
     $this->middleware('auth');
     $this->loadLayout();
 }