class SessionsController < ApplicationController def create user = User.from_omniauth env['omniauth.auth'] session[:user_id] = user.id redirect_to root_url, notice: 'Signed in successfully' end def failure redirect_to root_url, notice: 'Sign in failed' end def destroy session.delete(:user_id) redirect_to root_url, notice: 'Signed out successfully' end end