Skip to content
Snippets Groups Projects
Commit 805a7cf4 authored by Volkan Gezer's avatar Volkan Gezer
Browse files

Merge pull request #9338 from owncloud/fix-redirect-for-appframework

Redirect after session expiry to the previous loaded page
parents 9933b331 d31e5327
Branches
No related tags found
No related merge requests found
......@@ -143,6 +143,8 @@ class SecurityMiddleware extends Middleware {
// TODO: replace with link to route
$url = $this->urlGenerator->getAbsoluteURL('index.php');
// add redirect URL to redirect to the previous page after login
$url .= '?redirect_url=' . urlencode($this->request->server['REQUEST_URI']);
$response = new RedirectResponse($url);
$this->logger->debug($exception->getMessage());
}
......
......@@ -313,7 +313,8 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase {
public function testAfterExceptionReturnsRedirect(){
$this->request = new Request(
array('server' =>
array('HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
array('HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'REQUEST_URI' => 'owncloud/index.php/apps/specialapp')
)
);
$this->middleware = $this->getMiddleware(true, true);
......@@ -321,6 +322,7 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase {
$this->secException);
$this->assertTrue($response instanceof RedirectResponse);
$this->assertEquals('?redirect_url=owncloud%2Findex.php%2Fapps%2Fspecialapp', $response->getRedirectURL());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment