Skip to content

Instantly share code, notes, and snippets.

@armandofox
Created February 16, 2016 01:12
Show Gist options
  • Save armandofox/69972ca0d08712661b34 to your computer and use it in GitHub Desktop.
Save armandofox/69972ca0d08712661b34 to your computer and use it in GitHub Desktop.
omniauth_example.rb
class SessionsController < ApplicationController
def create
@user = User.find_or_create_from_auth_hash(auth_hash)
self.current_user = @user
redirect_to '/'
end
protected
def auth_hash
request.env['omniauth.auth']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment