fabpot/Silex — Issue #246: ->before() redirect causes "The page isn't redirecting properly"
Author: leeoniya
Created: 2012-01-29 22:58:06+00:00
State: open

for some reason, the following code is not working for me with either ```return new RedirectResponse('/login');``` or ```return $app->redirect('/login');```

```php
before(function(Request $req) use ($app) {
// validate user
if (null == $user = $app['session']->get('user'))
return $app->redirect('/login');
//	return new RedirectResponse('/login');

// validate other stuff...
//	return $app->redirect('/login');
});

$app->get('/login', function() {
return 'login page!';
});
```