Created
June 17, 2014 22:28
-
-
Save pelargir/15da6cb1bdf23d1a0cf5 to your computer and use it in GitHub Desktop.
This file contains 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
class OmniauthCallbacksController < ApplicationController | |
def wordpress_oauth2 | |
self.current_user = User.find_for_wordpress_oauth2(request.env['omniauth.auth']) | |
if current_user | |
flash[:notice] = "Logged in successfully" | |
current_user.record_login request.user_agent | |
else | |
flash.now[:error] = "Something went wrong (unable to login)" | |
end | |
redirect_back_or_default root_url | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment