From bc30c4bb99a2d13bcf28461203fc2a33e3c9fb3f Mon Sep 17 00:00:00 2001 From: Juan Wajnerman Date: Thu, 19 Sep 2019 17:24:54 -0300 Subject: [PATCH] Redirect to the requested URL after login with Google (fixes #41) --- app/views/devise/shared/_omniauth_links.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/devise/shared/_omniauth_links.haml b/app/views/devise/shared/_omniauth_links.haml index 240c757..26a32c1 100644 --- a/app/views/devise/shared/_omniauth_links.haml +++ b/app/views/devise/shared/_omniauth_links.haml @@ -1,6 +1,6 @@ - if devise_mapping.omniauthable? - resource_class.omniauth_providers.each do |provider| - - origin = session[:last_oidreq] ? '/openid/login' : nil + - origin = session[:last_oidreq] ? '/openid/login' : session[:user_return_to] - if provider.to_s == 'google' = link_to "", omniauth_authorize_path(resource_name, provider, origin: origin), class: provider.to_s - else