From 3db67b7bb43e37b6a858ffdd06a057596e160fc6 Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Mon, 4 Mar 2024 03:22:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=90=D1=83=D1=82=D0=B5=D0=BD=D1=82=D0=B8?= =?UTF-8?q?=D1=84=D0=B8=D0=BA=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B8=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B1=D1=80=D0=BE=D1=81=20=D0=BD=D0=B0=20=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=B8=D0=BD=20=D1=81=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../site/src/Controller/LoginController.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 com_oauthserver/site/src/Controller/LoginController.php diff --git a/com_oauthserver/site/src/Controller/LoginController.php b/com_oauthserver/site/src/Controller/LoginController.php new file mode 100644 index 0000000..80ecb20 --- /dev/null +++ b/com_oauthserver/site/src/Controller/LoginController.php @@ -0,0 +1,36 @@ +app; + $user = $app->getIdentity(); + + if (!$user->id) { + $return = http_build_query(['return' => base64_encode(Uri::getInstance()->toString(['scheme', 'user', 'pass', 'host', 'port', 'path']))]); + $this->app->setUserState('oauthserver.login.authorize.request', Uri::getInstance()->getQuery(true)); + $this->app->enqueueMessage('Необходимо авторизоваться!'); + $this->app->redirect(Route::_('index.php?option=com_users&view=login&' . $return)); + } + + $clientRepository = new ClientRepository($this->factory); + var_dump($this->app->getUserState('oauthserver.login.authorize.request')); + die(); + } +} \ No newline at end of file