<commit_before>%W{
  pathname

  openid
  openid/consumer/discovery
  openid/extensions/sreg
  openid/extensions/pape
  openid/store/filesystem
}.each{|l| require l}

class OpenidController < ApplicationController
  include OpenID::Server

  get_and_post '/?' do
    begin
      oidreq = server.decode_request(params)
    rescue ProtocolError => e
      # invalid openid request, so just display a page with an error message
      logger.debug "Invalid openid request: #{e.to_s}"
      halt 400, "Invalid openid request"
    end

    # no openid.mode was given
    unless oidreq
      logger.debug "No oidreq"
      halt 400, "Invalid openid request"
    end
    oidresp = nil

    if oidreq.kind_of?(CheckIDRequest)

      identity = oidreq.identity

      if oidreq.id_select
        if oidreq.immediate
          oidresp = oidreq.answer(false)
        elsif current_user.nil?
          # The user hasn't logged in.
          redirect_to_auth(oidreq)
          return
        else<commit_msg>Fixing broken openid<commit_after>%W{
  pathname

  openid
  openid/consumer/discovery
  openid/extensions/sreg
  openid/extensions/pape
  openid/store/filesystem
}.each{|l| require l}

class OpenidController < ApplicationController
  include OpenID::Server

  get_and_post '/?' do
    begin
      oidreq = server.decode_request(params)
    rescue ProtocolError => e
      # invalid openid request, so just display a page with an error message
      logger.debug "Invalid openid request: #{e.to_s}"
      halt 400, "Invalid openid request"
    end

    # no openid.mode was given
    unless oidreq
      logger.debug "No oidreq"
      halt 200, "This is an OpenID endpoint. You're probably looking for <a href=\"https://#{CCConfig[:external_uri]}\">https://#{CCConfig[:external_uri]}</a>"
    end
    oidresp = nil

    if oidreq.kind_of?(CheckIDRequest)

      identity = oidreq.identity

      if oidreq.id_select
        if oidreq.immediate
          oidresp = oidreq.answer(false)
        elsif current_user.nil?
          # The user hasn't logged in.
          redirect_to_auth(oidreq)
          return
        else
{'fraction_non_alphanumeric': 0.08325449385052035, 'fraction_numerical': 0.005676442762535478, 'mean_word_length': 2.640275387263339, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '3808191', 'n_tokens_mistral': 680, 'n_tokens_neox': 647, 'n_words': 175}