diff options
Diffstat (limited to 'main/app/sprinkles/account/src/Error/Handler/AuthExpiredExceptionHandler.php')
-rw-r--r-- | main/app/sprinkles/account/src/Error/Handler/AuthExpiredExceptionHandler.php | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/main/app/sprinkles/account/src/Error/Handler/AuthExpiredExceptionHandler.php b/main/app/sprinkles/account/src/Error/Handler/AuthExpiredExceptionHandler.php deleted file mode 100644 index fb04bd1..0000000 --- a/main/app/sprinkles/account/src/Error/Handler/AuthExpiredExceptionHandler.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php
-/**
- * UserFrosting (http://www.userfrosting.com)
- *
- * @link https://github.com/userfrosting/UserFrosting
- * @license https://github.com/userfrosting/UserFrosting/blob/master/licenses/UserFrosting.md (MIT License)
- */
-
-namespace UserFrosting\Sprinkle\Account\Error\Handler;
-
-use UserFrosting\Sprinkle\Core\Error\Handler\HttpExceptionHandler;
-
-/**
- * Handler for AuthExpiredExceptions.
- *
- * Forwards the user to the login page when their session has expired.
- * @author Alex Weissman (https://alexanderweissman.com)
- */
-class AuthExpiredExceptionHandler extends HttpExceptionHandler
-{
- /**
- * Custom handling for requests that did not pass authentication.
- */
- public function handle() {
- // For auth expired exceptions, we always add messages to the alert stream.
- $this->writeAlerts();
-
- $response = $this->response;
-
- // For non-AJAX requests, we forward the user to the login page.
- if (!$this->request->isXhr()) {
- $uri = $this->request->getUri();
- $path = $uri->getPath();
- $query = $uri->getQuery();
- $fragment = $uri->getFragment();
-
- $path = $path
- . ($query ? '?' . $query : '')
- . ($fragment ? '#' . $fragment : '');
-
- $loginPage = $this->ci->router->pathFor('login', [], [
- 'redirect' => $path
- ]);
-
- $response = $response->withRedirect($loginPage);
- }
-
- return $response;
- }
-}
|