From 5e4990faddfd05a1f368e4d6d6070a9d1ff55dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Thu, 29 Nov 2018 09:54:36 +0100 Subject: [PATCH] Remove redirect page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/Controller/ClientFlowLoginController.php | 28 ----------------- core/js/login/grant.js | 9 ++++++ core/js/login/redirect.js | 3 -- core/routes.php | 1 - core/templates/loginflow/grant.php | 15 ++++++--- core/templates/loginflow/redirect.php | 31 ------------------- 6 files changed, 20 insertions(+), 67 deletions(-) create mode 100644 core/js/login/grant.js delete mode 100644 core/js/login/redirect.js delete mode 100644 core/templates/loginflow/redirect.php diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php index 2e8216c2ba..83bd9faa6c 100644 --- a/core/Controller/ClientFlowLoginController.php +++ b/core/Controller/ClientFlowLoginController.php @@ -242,34 +242,6 @@ class ClientFlowLoginController extends Controller { ); } - /** - * @NoAdminRequired - * @NoCSRFRequired - * @UseSession - * - * @param string $stateToken - * @param string $clientIdentifier - * @return TemplateResponse - */ - public function redirectPage($stateToken = '', - $clientIdentifier = '') { - if(!$this->isValidToken($stateToken)) { - return $this->stateTokenForbiddenResponse(); - } - - return new TemplateResponse( - $this->appName, - 'loginflow/redirect', - [ - 'urlGenerator' => $this->urlGenerator, - 'stateToken' => $stateToken, - 'clientIdentifier' => $clientIdentifier, - 'oauthState' => $this->session->get('oauth.state'), - ], - 'guest' - ); - } - /** * @NoAdminRequired * @UseSession diff --git a/core/js/login/grant.js b/core/js/login/grant.js new file mode 100644 index 0000000000..c3c3371b17 --- /dev/null +++ b/core/js/login/grant.js @@ -0,0 +1,9 @@ +jQuery(document).ready(function() { + $('#submit').click(function (e) { + $('#submit + .submit-icon') + .removeClass('icon-confirm-white') + .addClass(OCA.Theming && OCA.Theming.inverted + ? 'icon-loading-small' + : 'icon-loading-small-dark'); + }) +}) \ No newline at end of file diff --git a/core/js/login/redirect.js b/core/js/login/redirect.js deleted file mode 100644 index ea214feab2..0000000000 --- a/core/js/login/redirect.js +++ /dev/null @@ -1,3 +0,0 @@ -jQuery(document).ready(function() { - $('#submit-redirect-form').trigger('click'); -}); diff --git a/core/routes.php b/core/routes.php index 88f919bdd2..c33fc6487f 100644 --- a/core/routes.php +++ b/core/routes.php @@ -52,7 +52,6 @@ $application->registerRoutes($this, [ ['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'], ['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'], ['name' => 'ClientFlowLogin#showAuthPickerPage', 'url' => '/login/flow', 'verb' => 'GET'], - ['name' => 'ClientFlowLogin#redirectPage', 'url' => '/login/flow/redirect', 'verb' => 'GET'], ['name' => 'ClientFlowLogin#generateAppPassword', 'url' => '/login/flow', 'verb' => 'POST'], ['name' => 'ClientFlowLogin#grantPage', 'url' => '/login/flow/grant', 'verb' => 'GET'], ['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'], diff --git a/core/templates/loginflow/grant.php b/core/templates/loginflow/grant.php index a03b31f762..017bb1f23c 100644 --- a/core/templates/loginflow/grant.php +++ b/core/templates/loginflow/grant.php @@ -19,7 +19,7 @@ * */ -script('core', 'login/authpicker'); +script('core', 'login/grant'); style('core', 'login/authpicker'); /** @var array $_ */ @@ -39,8 +39,15 @@ $urlGenerator = $_['urlGenerator'];
+ + + + +
+ +
+
+

diff --git a/core/templates/loginflow/redirect.php b/core/templates/loginflow/redirect.php deleted file mode 100644 index 200decfbed..0000000000 --- a/core/templates/loginflow/redirect.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ -script('core', 'login/redirect'); -style('core', 'login/authpicker'); - -/** @var array $_ */ -/** @var \OCP\IURLGenerator $urlGenerator */ -$urlGenerator = $_['urlGenerator']; -?> - -
-

t('Redirecting …')) ?>

-