Devise + Omniauth - How to pass extra parameters along?

后端 未结 3 1440
孤独总比滥情好
孤独总比滥情好 2020-11-29 21:38

I have the ability in the app to load /users/auth/facebook to connect to facebook. I want to be able to know where the request came from. Whether it was from a user who is r

3条回答
  •  迷失自我
    2020-11-29 22:18

    If the request is made from different pages in your application, you can examine the request.env['omniauth.origin']. Omniauth saves this variable automatically.

    Here is a more detailed explanation

    As far as passing custom parameters, I have tried to do this unsuccessfully. The workaround is to store it in the session before going to the provider as explained here.

    Hope this helps you.

提交回复
热议问题