Files
sure/app/views/doorkeeper/authorizations/new.html.erb
Juan José Mata 7c5ddd674d Make branding configurable (#173)
* Remove orphan function

* Add centralized branding helpers and update locales

* Remove _plus and add (proper) brand

* No longer Sure, configurable

* Consistency with compose file naming

* Missed `product_name` mapping

* Fix brand/product name in mailers

* Product name in email reset flow

* Fix i18n errors/tests

* Fix password mailer brand/product name (again)

* Missed hardcoded `Sure` in onboarding goals

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Juan José Mata <jjmata@jjmata.com>

* PR nitpick on documentation

* Missing interpolation key for invited UI

* Orphan assets

* New logos

---------

Signed-off-by: Juan José Mata <jjmata@jjmata.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-22 19:14:03 +02:00

77 lines
3.4 KiB
Plaintext

<% if params[:redirect_uri]&.start_with?('sureapp://') || params[:display] == 'mobile' %>
<meta name="turbo-visit-control" content="reload">
<% end %>
<div class="bg-container rounded-xl p-6 space-y-6">
<div class="space-y-2 text-center">
<p class="text-sm text-secondary">
<%= raw t(".prompt", client_name: content_tag(:span, @pre_auth.client.name, class: "font-medium text-primary")) %>
</p>
</div>
<% if @pre_auth.scopes.count > 0 %>
<div class="bg-surface-inset rounded-lg p-4 space-y-3">
<p class="text-sm font-medium text-primary"><%= t(".able_to") %>:</p>
<ul class="space-y-2">
<% @pre_auth.scopes.each do |scope| %>
<li class="flex items-start gap-2 text-sm text-secondary">
<%= icon("check", class: "w-4 h-4 mt-0.5 text-success") %>
<span><%= t scope, scope: [:doorkeeper, :scopes] %></span>
</li>
<% end %>
</ul>
</div>
<% end %>
<div class="space-y-3">
<% turbo_disabled = params[:redirect_uri]&.start_with?("sureapp://") || params[:display] == "mobile" %>
<%= form_tag oauth_authorization_path, method: :post, class: "w-full", data: { turbo: !turbo_disabled } do %>
<%= hidden_field_tag :client_id, @pre_auth.client.uid, id: nil %>
<%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri, id: nil %>
<%= hidden_field_tag :state, @pre_auth.state, id: nil %>
<%= hidden_field_tag :response_type, @pre_auth.response_type, id: nil %>
<%= hidden_field_tag :response_mode, @pre_auth.response_mode, id: nil %>
<%= hidden_field_tag :scope, @pre_auth.scope, id: nil %>
<%= hidden_field_tag :code_challenge, @pre_auth.code_challenge, id: nil %>
<%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method, id: nil %>
<% if params[:display].present? %>
<%= hidden_field_tag :display, params[:display], id: nil %>
<% end %>
<%= render DS::Button.new(
text: t("doorkeeper.authorizations.buttons.authorize"),
variant: :primary,
size: :lg,
full_width: true,
href: oauth_authorization_path,
data: { disable_with: "Authorizing..." }
) %>
<% end %>
<%= form_tag oauth_authorization_path, method: :delete, class: "w-full", data: { turbo: !turbo_disabled } do %>
<%= hidden_field_tag :client_id, @pre_auth.client.uid, id: nil %>
<%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri, id: nil %>
<%= hidden_field_tag :state, @pre_auth.state, id: nil %>
<%= hidden_field_tag :response_type, @pre_auth.response_type, id: nil %>
<%= hidden_field_tag :response_mode, @pre_auth.response_mode, id: nil %>
<%= hidden_field_tag :scope, @pre_auth.scope, id: nil %>
<%= hidden_field_tag :code_challenge, @pre_auth.code_challenge, id: nil %>
<%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method, id: nil %>
<% if params[:display].present? %>
<%= hidden_field_tag :display, params[:display], id: nil %>
<% end %>
<%= render DS::Button.new(
text: t("doorkeeper.authorizations.buttons.deny"),
variant: :outline,
size: :lg,
full_width: true,
href: oauth_authorization_path,
data: { disable_with: "Denying..." }
) %>
<% end %>
</div>
<p class="text-xs text-tertiary text-center">
By authorizing, you allow this app to access your <%= product_name %> data according to the permissions above.
</p>
</div>