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()]); }
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(); }
public function auth($provider = null) { if (!$this->auth) { $this->auth = resolve(Auth::class); } if ($provider) { $this->auth->useProvider($provider); } return $this->auth; }