Skip to content

Instantly share code, notes, and snippets.

View pama's full-sized avatar

Paulo Abreu pama

View GitHub Profile
class SessionsController < ApplicationController
def create
auth = request.env["omniauth.auth"]
session[:omniauth] = auth.except('extra')
user = User.sign_in_from_omniauth(auth)
session[:user_id] = user.id
redirect_to root_url, notice: "Signed In"
end