Skip to content

Commit

Permalink
Merge pull request #241 from nextcloud/redirect2
Browse files Browse the repository at this point in the history
Add orignalURL to redirect when using SSO
  • Loading branch information
schiessle authored Aug 17, 2018
2 parents 378cd6e + 3f3cd68 commit f07420d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Controller/SAMLController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
* @copyright Copyright (c) 2018 Jean-Baptiste Pin <jibet.pin@gmail.com>
*
* @license GNU AGPL version 3 or any later version
*
Expand Down Expand Up @@ -160,7 +161,10 @@ public function login($idp) {
$this->session->set('user_saml.Idp', $idp);
break;
case 'environment-variable':
$ssoUrl = $this->urlGenerator->getAbsoluteURL('/');
$ssoUrl = $this->request->getParam('originalUrl', '');
if (empty($ssoUrl)) {
$ssoUrl = $this->urlGenerator->getAbsoluteURL('/');
}
$this->session->set('user_saml.samlUserData', $_SERVER);
try {
$this->autoprovisionIfPossible($this->session->get('user_saml.samlUserData'));
Expand Down

0 comments on commit f07420d

Please sign in to comment.