class ApplicationController < ActionController::Base protect_from_forgery with: :null_session require 'sso' before_action :current_user protected def current_user @current_user ||= User.find_by(external_id: session[:current_user]) if session[:current_user].present? end helper_method :current_user end