0

In my Symfony2 project i am using HWIOauthBundle to login users with facebook account. and what i wanna do is redirect the user to a route that has parameters after a success login. Is there any way to set default_target_path in firewall as dynamic?

this is the route that i want to redirect the user to:

my_route:
    pattern:  /upload/{caseNumber}/{token}
    defaults: { _controller: UploadBundle:Upload:upload}

and the firewall configuration:

 firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false        

        main:
            anonymous: true
            pattern: ^/
            oauth:
                resource_owners:
                    facebook: "/login/check-facebook"
                login_path:   /login
                failure_path: /login
                default_target_path: /upload/00044710/500f5BBQP
                oauth_user_provider:
                    service: ib_user.oauth_user_provider                
            remember_me:
                key:     "%secret%"

the problem as you can see in default_target_path: /upload/00044710/500f5BBQP is that the case number and token can change. So how can i set it dynamically .

Niklas
  • 13,005
  • 23
  • 79
  • 119
ihssan
  • 369
  • 1
  • 6
  • 24

1 Answers1

0

You can redirect to an action that will find the correct url and further redirect the user.

Bartłomiej Wach
  • 1,968
  • 1
  • 11
  • 17