Skip to content

Instantly share code, notes, and snippets.

@aliang
Created March 31, 2011 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aliang/896096 to your computer and use it in GitHub Desktop.
Save aliang/896096 to your computer and use it in GitHub Desktop.
returning after omniauth
# Link to /sign-in/:provider?return_to=current_page in your view. This example shows auth using Twitter in a HAML view
%a{ :href => "/sign-in/twitter?return_to=" + request.env['PATH_INFO'] }
# Add this to your routes.rb file
match "/sign-in/:provider" => "sessions#sign_in"
# Add this to your sessions controller.
def sign_in
session[:return_to] = params[:return_to]
redirect_to "/auth/" + params[:provider]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment