class Registrar::SessionsController < Registrar::ApplicationController
  skip_action_callback :require_signed_in_user

  def new
  end

  def create
    if authorized_email?
      user = User.create_with(user_hash).find_or_create_by(email: email)
      sign_in(user)

      redirect = session[:target] || root_path

      redirect_to redirect
    else
      render :new
    end
  end

  def destroy
    sign_out

    redirect_to registrar.signin_path
  end

  private

  def auth_hash
    request.env["omniauth.auth"].with_indifferent_access
  end

  def user_hash
    auth_hash[:info].slice("first_name", "last_name", "email")
  end

  def email
    auth_hash[:info][:email]
  end

  def authorized_email?
    EmailChecker.new(email).authorized?
  end
end

class Registrar::SessionsController < Registrar::ApplicationController
  def new
  end

  def create
    if authorized_email?
      user = User.create_with(user_hash).find_or_create_by(email: email)
      sign_in(user)

      redirect = session[:target] || root_path

      redirect_to redirect
    else
      render :new
    end
  end

  def destroy
    sign_out

    redirect_to registrar.signin_path
  end

  private

  def auth_hash
    request.env["omniauth.auth"].with_indifferent_access
  end

  def user_hash
    auth_hash[:info].slice("first_name", "last_name", "email")
  end

  def email
    auth_hash[:info][:email]
  end

  def authorized_email?
    EmailChecker.new(email).authorized?
  end
end

Remove unneeded and unused callback.
Remove unneeded and unused callback.

This was not working (incorrect syntax) in the past. I updated it in
this PR https://github.com/procore/registrar/pull/27 while upgrading to
Rails 5. (See attached PR for relevant discussion) After double
checking, this callback can indeed get removed.
