summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Controller/AuthController.php16
-rw-r--r--app/Controller/BaseController.php16
-rw-r--r--app/Controller/OAuthController.php2
3 files changed, 17 insertions, 17 deletions
diff --git a/app/Controller/AuthController.php b/app/Controller/AuthController.php
index 06bcd913..474783eb 100644
--- a/app/Controller/AuthController.php
+++ b/app/Controller/AuthController.php
@@ -64,20 +64,4 @@ class AuthController extends BaseController
$this->response->redirect($this->helper->url->to('DashboardController', 'show'));
}
}
-
- /**
- * Redirect the user after the authentication
- *
- * @access private
- */
- private function redirectAfterLogin()
- {
- if (session_exists('redirectAfterLogin') && ! filter_var(session_get('redirectAfterLogin'), FILTER_VALIDATE_URL)) {
- $redirect = session_get('redirectAfterLogin');
- session_remove('redirectAfterLogin');
- $this->response->redirect($redirect);
- } else {
- $this->response->redirect($this->helper->url->to('DashboardController', 'show'));
- }
- }
}
diff --git a/app/Controller/BaseController.php b/app/Controller/BaseController.php
index 1433ec14..c984a702 100644
--- a/app/Controller/BaseController.php
+++ b/app/Controller/BaseController.php
@@ -305,4 +305,20 @@ abstract class BaseController extends Base
return $filter;
}
+
+ /**
+ * Redirect the user after the authentication
+ *
+ * @access protected
+ */
+ protected function redirectAfterLogin()
+ {
+ if (session_exists('redirectAfterLogin') && ! filter_var(session_get('redirectAfterLogin'), FILTER_VALIDATE_URL)) {
+ $redirect = session_get('redirectAfterLogin');
+ session_remove('redirectAfterLogin');
+ $this->response->redirect($redirect);
+ } else {
+ $this->response->redirect($this->helper->url->to('DashboardController', 'show'));
+ }
+ }
}
diff --git a/app/Controller/OAuthController.php b/app/Controller/OAuthController.php
index 7663ddcc..abd9b2e7 100644
--- a/app/Controller/OAuthController.php
+++ b/app/Controller/OAuthController.php
@@ -106,7 +106,7 @@ class OAuthController extends BaseController
protected function authenticate($providerName)
{
if ($this->authenticationManager->oauthAuthentication($providerName)) {
- $this->response->redirect($this->helper->url->to('DashboardController', 'show'));
+ $this->redirectAfterLogin();
} else {
$this->authenticationFailure(t('External authentication failed'));
}