Skip to content

Commit

Permalink
add "blank=true" param to sameWindow redirect url.
Browse files Browse the repository at this point in the history
This will notify the client not to render the page
  • Loading branch information
lynndylanhurley committed Oct 27, 2015
1 parent 52347c4 commit 9927d3c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def omniauth_params
end
end
@_omniauth_params

end

# break out provider attribute assignment for easy method extension
Expand Down Expand Up @@ -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
Expand All @@ -225,7 +225,7 @@ def fallback_render(text)
<body>
#{text}
</body>
</html>|
</html>|
end

def get_resource_from_auth_hash
Expand Down

0 comments on commit 9927d3c

Please sign in to comment.