<commit_before>module Authentication

  protected

    ##
    # Before doing nothing on Typus require_login
    #
    def require_login
      redirect_to typus_login_url unless session[:typus]
    end

    ##
    # Check if the user is logged on the system.
    #
    def logged_in?
      return false unless session[:typus]
      begin
        @current_user ||= TypusUser.find(session[:typus])
      rescue ActiveRecord::RecordNotFound
        session[:typus] = nil
      end
    end

    ##
    # Return the current user
    #<commit_msg>Remember where I tried to go ...<commit_after>module Authentication

  protected

    ##
    # Before doing nothing on Typus require_login
    #
    def require_login
      redirect_to typus_login_url(:back_to => request.env['REQUEST_PATH']) unless session[:typus]
    end

    ##
    # Check if the user is logged on the system.
    #
    def logged_in?
      return false unless session[:typus]
      begin
        @current_user ||= TypusUser.find(session[:typus])
      rescue ActiveRecord::RecordNotFound
        session[:typus] = nil
      end
    end

    ##
    # Return the current user
    #
{'fraction_non_alphanumeric': 0.07982456140350877, 'fraction_numerical': 0.0, 'mean_word_length': 2.4264264264264264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4411094', 'n_tokens_mistral': 333, 'n_tokens_neox': 325, 'n_words': 95}