You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: application_controller.rb
    path of file: ./repos/hacktoberfest-2020/app/controllers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class ApplicationController < ActionController::Base
  before_action :set_current_user
  
    
  def current_user
    return unless logged_in?

    if (user = User.find_by(id: session[:current_user_id]))
      user
    else
      reset_session
      redirect_to root_path
    end