<commit_before><header class="page-header" role="banner">
  <h1><%= t('.title') %></h1>
</header>

<main role="main">
  <% if @current_resource_owner.present? %>
    <p class="h4">
      <%=  sanitize(_("%{application} wants to access your DMPs. Please confirm this action.") % { application: "<strong class=\"text-info\">#{@pre_auth.client.name.humanize}</strong>" }) %>
    </p>
  <% else %>
    <p class="h4">
      <%=  sanitize(_("%{application} wants to access your DMPs. Please sign in to verify your account.") % { application: "<strong class=\"text-info\">#{@pre_auth.client.name.humanize}</strong>" }) %>
    </p>
  <% end %>

  <% if @current_resource_owner.present? %>
    <% if @pre_auth.scopes.count > 0 %>
      <div id="oauth-permissions">
        <p><%= t('.able_to') %>:</p>

        <ul class="text-info">
          <% @pre_auth.scopes.each do |scope| %>
            <li><%= user_label_for_scope(scope) %></li>
          <% end %>
        </ul>
      </div>
    <% end %>

    <div class="actions">
      <%= form_tag oauth_authorization_path, method: :post do %>
        <%= hidden_field_tag :client_id, @pre_auth.client.uid %>
        <%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri %>
        <%= hidden_field_tag :state, @pre_auth.state %>
        <%= hidden_field_tag :response_type, @pre_auth.response_type %>
        <%= hidden_field_tag :scope, @pre_auth.scope %>
        <%= hidden_field_tag :code_challenge, @pre_auth.code_challenge %>
        <%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method %>
        <%= submit_tag t('doorkeeper.authorizations.buttons.authorize'), class: "btn btn-success btn-lg btn-block" %>
      <% end %>
      <%= form_tag oauth_authorization_path, method: :delete do %>
        <%= hidden_field_tag :client_id, @pre_auth.client.uid %>
        <%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri %>
        <%= hidden_field_tag :state, @pre_auth.state %>
        <%= hidden_field_tag :response_type, @pre_auth.response_type %>
        <%= hidden_field_tag :scope, @pre_auth.scope %>
        <%= hidden_field_tag :code_challenge, @pre_auth.code_challenge %>
        <%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method %>
        <%= submit_tag t('doorkeeper.authorizations.buttons.deny'), class: "btn btn-danger btn-lg btn-block" %>
      <% end %>
    </div>

  <% else %>
    <% if Rails.configuration.x.shibboleth_enabled %>
      <%# Set a session variable so we can notify the omniauth_callback controller that this is an OAuth workflow %>
      <% session["oauth-referer"] = oauth_authorization_path(client_id: @pre_auth.client.uid,
                                                             redirect_uri: @pre_auth.redirect_uri,
                                                             state: @pre_auth.state,
                                                             response_type: @pre_auth.response_type,
                                                             scope: @pre_auth.scope,
                                                             code_challenge: @pre_auth.code_challenge,
                                                             code_challenge_method: @pre_auth.code_challenge_method) %>
      <%= render partial: "shared/shib_sign_in_form" %>

      <p class="fontsize-h4">- <%= _('Or if your institution is not listed') %> -</p>
    <% end %>

    <%= render partial: "shared/sign_in_form", locals: { resource: User.new } %>
  <% end %>
</main>
<commit_msg>fixed issue with oauth error handling<commit_after><header class="page-header" role="banner">
  <h1><%= t('.title') %></h1>
</header>

<main role="main">
  <%# Set a session variable so we can notify the application_controller that this is an OAuth workflow %>
  <% session["oauth-referer"] = oauth_authorization_path(client_id: @pre_auth.client.uid,
                                                          redirect_uri: @pre_auth.redirect_uri,
                                                          state: @pre_auth.state,
                                                          response_type: @pre_auth.response_type,
                                                          scope: @pre_auth.scope,
                                                          code_challenge: @pre_auth.code_challenge,
                                                          code_challenge_method: @pre_auth.code_challenge_method) %>

  <% if @current_resource_owner.present? %>
    <p class="h4">
      <%=  sanitize(_("%{application} wants to access your DMPs. Please confirm this action.") % { application: "<strong class=\"text-info\">#{@pre_auth.client.name.humanize}</strong>" }) %>
    </p>
  <% else %>
    <p class="h4">
      <%=  sanitize(_("%{application} wants to access your DMPs. Please sign in to verify your account.") % { application: "<strong class=\"text-info\">#{@pre_auth.client.name.humanize}</strong>" }) %>
    </p>
  <% end %>

  <% if @current_resource_owner.present? %>
    <% if @pre_auth.scopes.count > 0 %>
      <div id="oauth-permissions">
        <p><%= t('.able_to') %>:</p>

        <ul class="text-info">
          <% @pre_auth.scopes.each do |scope| %>
            <li><%= user_label_for_scope(scope) %></li>
          <% end %>
        </ul>
      </div>
    <% end %>

    <div class="actions">
      <%= form_tag oauth_authorization_path, method: :post do %>
        <%= hidden_field_tag :client_id, @pre_auth.client.uid %>
        <%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri %>
        <%= hidden_field_tag :state, @pre_auth.state %>
        <%= hidden_field_tag :response_type, @pre_auth.response_type %>
        <%= hidden_field_tag :scope, @pre_auth.scope %>
        <%= hidden_field_tag :code_challenge, @pre_auth.code_challenge %>
        <%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method %>
        <%= submit_tag t('doorkeeper.authorizations.buttons.authorize'), class: "btn btn-success btn-lg btn-block" %>
      <% end %>
      <%= form_tag oauth_authorization_path, method: :delete do %>
        <%= hidden_field_tag :client_id, @pre_auth.client.uid %>
        <%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri %>
        <%= hidden_field_tag :state, @pre_auth.state %>
        <%= hidden_field_tag :response_type, @pre_auth.response_type %>
        <%= hidden_field_tag :scope, @pre_auth.scope %>
        <%= hidden_field_tag :code_challenge, @pre_auth.code_challenge %>
        <%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method %>
        <%= submit_tag t('doorkeeper.authorizations.buttons.deny'), class: "btn btn-danger btn-lg btn-block" %>
      <% end %>
    </div>

  <% else %>
    <% if Rails.configuration.x.shibboleth_enabled %>
      <%= render partial: "shared/shib_sign_in_form" %>

      <p class="fontsize-h4">- <%= _('Or if your institution is not listed') %> -</p>
    <% end %>

    <%= render partial: "shared/sign_in_form", locals: { resource: User.new } %>
  <% end %>
</main>

{'fraction_non_alphanumeric': 0.15122712441481062, 'fraction_numerical': 0.0017023691303731025, 'mean_word_length': 2.3539486203615603, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 141, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4035572', 'n_tokens_mistral': 2317, 'n_tokens_neox': 2091, 'n_words': 400}