gigablah / silex-oauth

Silex provider for lusitanian/oauth.
MIT License
109 stars 24 forks source link

Redirect to specified path? #22

Closed pjcdawkins closed 9 years ago

pjcdawkins commented 9 years ago

I'm trying to have a login redirected back to a specified path on success.

I've tried what appears to be the Symfony default, _target_path, and that doesn't work - does anyone know how to achieve this?

gigablah commented 9 years ago

You can use default_target_path.

$app->register(new Silex\Provider\SecurityServiceProvider(), array(
    'security.firewalls' => array(
        'default' => array(
            'pattern' => '^/',
            'anonymous' => true,
            'oauth' => array(
                // ...
                'default_target_path' => '/target_path'
            ),
            // ...
        )
    ),
    // ...
));