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