<% case @state %> <% when :confirm %>
<% if @application.icon.attached? %>
<%= app_icon_picture @application, class: "mx-auto h-20 w-20 rounded-xl object-cover border-2 border-gray-200 dark:border-gray-700 shadow-sm" %>
<% else %>
<%= render "shared/app_monogram", name: @application.name, class: "h-20 w-20 rounded-xl shadow-sm" %>
<% end %>

Authorize device

<%= @application.name %> is requesting access to your account from a device or command line.

Code shown on your device

<%= @device_code.user_code %>

Only approve if this matches the code your tool is showing.

<% if @scopes.any? %>

This will be able to:

<%= render "shared/scope_list", scopes: @scopes %>
<% end %> <%= form_with url: device_verification_path, method: :post, class: "space-y-3", data: { turbo: false }, local: true do |form| %> <%= form.hidden_field :user_code, value: @device_code.user_code %> <%= form.submit "Approve", class: "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 focus:ring-blue-500" %> <%= button_tag "Deny", type: :submit, name: :deny, value: "1", class: "w-full flex justify-center py-2 px-4 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 dark:ring-gray-600 hover:bg-gray-50 dark:hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 focus:ring-blue-500" %> <% end %> <% when :prompt %>

Enter device code

Type the code shown by your tool or command line.

<%= form_with url: device_verification_path, method: :get, class: "space-y-4", data: { turbo: false }, local: true do |form| %> <%= form.text_field :user_code, autofocus: true, autocomplete: "off", placeholder: "WDJB-MJHT", class: "block w-full text-center font-mono text-xl tracking-widest uppercase rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 shadow-sm focus:border-blue-500 focus:ring-blue-500" %> <%= form.submit "Continue", class: "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 focus:ring-blue-500" %> <% end %> <% else %> <%= render "terminal_state", state: @state %> <% end %>