Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove redirect page
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
  • Loading branch information
skjnldsv authored and Backportbot committed Nov 29, 2018
commit b208cce8895dd9d83ea6a88f2ce43680662e21d9
28 changes: 0 additions & 28 deletions core/Controller/ClientFlowLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,34 +242,6 @@ public function grantPage($stateToken = '',
);
}

/**
* @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
Expand Down
9 changes: 9 additions & 0 deletions core/js/login/grant.js
Original file line number Diff line number Diff line change
@@ -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');
})
})
3 changes: 0 additions & 3 deletions core/js/login/redirect.js

This file was deleted.

1 change: 0 additions & 1 deletion core/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
['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'],
Expand Down
15 changes: 11 additions & 4 deletions core/templates/loginflow/grant.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
*/

script('core', 'login/authpicker');
script('core', 'login/grant');
style('core', 'login/authpicker');

/** @var array $_ */
Expand All @@ -39,8 +39,15 @@
<br/>

<p id="redirect-link">
<a href="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLogin.redirectPage', ['stateToken' => $_['stateToken'], 'clientIdentifier' => $_['clientIdentifier'], 'oauthState' => $_['oauthState']])) ?>">
<input type="submit" class="login primary icon-confirm-white" value="<?php p($l->t('Grant access')) ?>">
</a>
<form method="POST" action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLogin.generateAppPassword')) ?>">
<input type="hidden" name="clientIdentifier" value="<?php p($_['clientIdentifier']) ?>" />
<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>
</div>
31 changes: 0 additions & 31 deletions core/templates/loginflow/redirect.php

This file was deleted.