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: deny_access_override_behavior.rb
    path of file: ./repos/hyrax/app/controllers/concerns/hyrax
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
module Hyrax
  module DenyAccessOverrideBehavior
    # Overriding the default behavior from
    
    def deny_access(exception)
      if current_user&.persisted?
        redirect_to root_path, alert: exception.message
      else
        session['user_return_to'] = request.url
        redirect_to main_app.new_user_session_path, alert: exception.message
      end