Remove redirect page
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
cba5ccfbaf
commit
5e4990fadd
|
@ -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
|
* @NoAdminRequired
|
||||||
* @UseSession
|
* @UseSession
|
||||||
|
|
|
@ -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');
|
||||||
|
})
|
||||||
|
})
|
|
@ -1,3 +0,0 @@
|
||||||
jQuery(document).ready(function() {
|
|
||||||
$('#submit-redirect-form').trigger('click');
|
|
||||||
});
|
|
|
@ -52,7 +52,6 @@ $application->registerRoutes($this, [
|
||||||
['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'],
|
['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'],
|
||||||
['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'],
|
['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'],
|
||||||
['name' => 'ClientFlowLogin#showAuthPickerPage', 'url' => '/login/flow', '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#generateAppPassword', 'url' => '/login/flow', 'verb' => 'POST'],
|
||||||
['name' => 'ClientFlowLogin#grantPage', 'url' => '/login/flow/grant', 'verb' => 'GET'],
|
['name' => 'ClientFlowLogin#grantPage', 'url' => '/login/flow/grant', 'verb' => 'GET'],
|
||||||
['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'],
|
['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'],
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
script('core', 'login/authpicker');
|
script('core', 'login/grant');
|
||||||
style('core', 'login/authpicker');
|
style('core', 'login/authpicker');
|
||||||
|
|
||||||
/** @var array $_ */
|
/** @var array $_ */
|
||||||
|
@ -39,8 +39,15 @@ $urlGenerator = $_['urlGenerator'];
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<p id="redirect-link">
|
<p id="redirect-link">
|
||||||
<a href="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLogin.redirectPage', ['stateToken' => $_['stateToken'], 'clientIdentifier' => $_['clientIdentifier'], 'oauthState' => $_['oauthState']])) ?>">
|
<form method="POST" action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLogin.generateAppPassword')) ?>">
|
||||||
<input type="submit" class="login primary icon-confirm-white" value="<?php p($l->t('Grant access')) ?>">
|
<input type="hidden" name="clientIdentifier" value="<?php p($_['clientIdentifier']) ?>" />
|
||||||
</a>
|
<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
|
||||||
|
<input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />
|
||||||
|
<input type="hidden" name="oauthState" value="<?php p($_['oauthState']) ?>" />
|
||||||
|
<div id="submit-wrapper">
|
||||||
|
<input type="submit" id="submit" class="login primary" title="" value="<?php p($l->t('Grant access')); ?>" />
|
||||||
|
<div class="submit-icon icon-confirm-white"></div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>
|
|
||||||
*
|
|
||||||
* @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 <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
script('core', 'login/redirect');
|
|
||||||
style('core', 'login/authpicker');
|
|
||||||
|
|
||||||
/** @var array $_ */
|
|
||||||
/** @var \OCP\IURLGenerator $urlGenerator */
|
|
||||||
$urlGenerator = $_['urlGenerator'];
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div class="picker-window">
|
|
||||||
<p><?php p($l->t('Redirecting …')) ?></p>
|
|
||||||
</div>
|
|
Loading…
Reference in New Issue