From 9927d3c669d1ba666a41a3fbc24ea7e444d5dd37 Mon Sep 17 00:00:00 2001 From: Lynn Hurley Date: Tue, 27 Oct 2015 02:29:14 -0500 Subject: [PATCH] add "blank=true" param to sameWindow redirect url. This will notify the client not to render the page --- .../devise_token_auth/omniauth_callbacks_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb b/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb index 9061c0d25..2cb044cf5 100644 --- a/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +++ b/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb @@ -71,7 +71,7 @@ def omniauth_params end end @_omniauth_params - + end # break out provider attribute assignment for easy method extension @@ -206,12 +206,12 @@ def render_data_or_redirect(message, data, user_data = {}) elsif auth_origin_url # default to same-window implementation, which forwards back to auth_origin_url # build and redirect to destination url - redirect_to DeviseTokenAuth::Url.generate(auth_origin_url, data) + redirect_to DeviseTokenAuth::Url.generate(auth_origin_url, data.merge(blank: true)) else - + # there SHOULD always be an auth_origin_url, but if someone does something silly # like coming straight to this url or refreshing the page at the wrong time, there may not be one. - # In that case, just render in plain text the error message if there is one or otherwise + # In that case, just render in plain text the error message if there is one or otherwise # a generic message. fallback_render data[:error] || 'An error occurred' end @@ -225,7 +225,7 @@ def fallback_render(text) #{text} - | + | end def get_resource_from_auth_hash