Created
October 16, 2012 17:38
-
-
Save patbenatar/3900776 to your computer and use it in GitHub Desktop.
After oauth login, return user to URL they came from with Devise + Omniauth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # link_to path | |
| user_omniauth_authorize_path(:facebook, origin: request.fullpath) | |
| # in ApplicationController | |
| def after_sign_in_path_for(resource) | |
| stored_location_for(resource) || request.env['omniauth.origin'] || root_path | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment