class Auth0Controller < ApplicationController
  def callback

    user = User.find_or_create_by(user_id: request.env['omniauth.auth']['user_id'])

    user.first_name = request.env['omniauth.auth']['info']['given_name']
    user.last_name = request.env['omniauth.auth']['info']['family_name']
    user.email = request.env['omniauth.auth']['info']['email']
    user.save

    session[:user_id] = user.user_id

    redirect_to '/'
  end

  def failure
    @error_msg = request.params['message']
  end
end

class Auth0Controller < ApplicationController
  def callback

    user = User.find_or_create_by(user_id: request.env['omniauth.auth']['uid'])

    user.first_name = request.env['omniauth.auth']['info']['last_name']
    user.last_name = request.env['omniauth.auth']['info']['first_name']
    user.email = request.env['omniauth.auth']['info']['email']

    binding.pry
    user.save!

    session[:user_id] = user.user_id

    redirect_to '/'
  end

  def failure
    @error_msg = request.params['message']
  end
end

Update how we access the information that auth0 returns back to us.
Update how we access the information that auth0 returns back to us.
