Rails 3 - Devise With OmniAuth - Redirect after signing in goes to /users/sign_in

后端 未结 3 769
滥情空心
滥情空心 2020-12-25 08:17

Im using devise with omniauth for signing in users with facebook. I want them to be redirected after signing in to the page they were on after before signing in.

I\'

3条回答
  •  自闭症患者
    2020-12-25 08:46

    did you consider the Devise provided helper sign_in_and_redirect(resource_or_scope, *args) (details can be found here)? You also get sign_out_and_redirect(resource_or_scope) amongst others.

    Q2. do try inspecting session[:return_to] - it's most likely nil.

提交回复
热议问题