Ejemplo n.º 1
0
Archivo: Auth.php Proyecto: pckg/auth
 function getRegisterAction(Register $registerForm, AuthService $authHelper, Response $response)
 {
     if ($authHelper->isLoggedIn()) {
         $response->redirect('/');
     }
     return view("vendor/lfw/auth/src/Pckg/Auth/View/register", ['form' => $registerForm->initFields()]);
 }
Ejemplo n.º 2
0
 public function execute(callable $next)
 {
     if ($this->auth->isLoggedIn() || !$this->request->isGet() || !isset($_COOKIE['pckg.auth.autologin'])) {
         return $next();
     }
     $cookie = unserialize($_COOKIE['pckg.auth.autologin']);
     foreach ($cookie as $provider => $data) {
         $this->auth->useProvider($provider);
         $this->auth->autologin($data['user_id']);
     }
     return $next();
 }
Ejemplo n.º 3
0
 public function auth($provider = null)
 {
     if (!$this->auth) {
         $this->auth = resolve(Auth::class);
     }
     if ($provider) {
         $this->auth->useProvider($provider);
     }
     return $this->auth;
 }