%= form_tag rodauth.oauth_applications_path, method: :post, class: "form-horizontal" do %>
Register Oauth Application
<%= rodauth.field_error('scope') %>
<%= label_tag "name", "Name" %>
<%= text_field_tag "name", rodauth.param('name'), class: "form-control#{' is-invalid' if rodauth.field_error('name')}" %>
<%= rodauth.field_error('name') %>
<%= label_tag "description", "Description" %>
<%= text_field_tag "description", rodauth.param('description'), class: "form-control#{' is-invalid' if rodauth.field_error('description')}" %>
<%= rodauth.field_error('description') %>
<%= label_tag "homepage_url", "Homepage URL" %>
<%= text_field_tag "homepage_url", rodauth.param('homepage_url'), class: "form-control#{' is-invalid' if rodauth.field_error('homepage_url')}" %>
<%= rodauth.field_error('homepage_url') %>
<%= label_tag "redirect_uri", "Redirect URL" %>
<%= text_field_tag "redirect_uri", rodauth.param('redirect_uri'), class: "form-control#{' is-invalid' if rodauth.field_error('redirect_uri')}" %>
<%= rodauth.field_error('redirect_uri') %>
<%= label_tag "client_secret", "Secret (make it random and at least 32 character-long)" %>
<%= text_field_tag "client_secret", rodauth.param('client_secret'), class: "form-control#{' is-invalid' if rodauth.field_error('client_secret')}" %>
<%= rodauth.field_error('client_secret') %>
<% rodauth.oauth_application_scopes.each do |scope| %>
<%= check_box_tag "scopes[]", scope, scope == rodauth.oauth_application_default_scope, id: scope, class: "form-check-input" %>
<%= scope %>
<% end %>
<%= submit_tag "Register", class: "btn btn-primary" %>
<% end %>