diff --git a/app/views/api_settings/index.html.erb b/app/views/api_settings/index.html.erb index 57f6fa16..6c15c755 100644 --- a/app/views/api_settings/index.html.erb +++ b/app/views/api_settings/index.html.erb @@ -46,7 +46,7 @@
<% text = capture do %>curl --location '<%= api_submissions_url %>' \ - --header 'X-Auth-Token: <%= current_user.access_token.token %>' \ + --header 'X-Auth-Token: API_TOKEN' \ --data-raw '{ "template_id": <%= current_account.templates.last&.id || 1 %>, "submitters": [ @@ -82,7 +82,7 @@
<% text = capture do %>curl --location '<%= api_submissions_emails_url %>' \ - --header 'X-Auth-Token: <%= current_user.access_token.token %>' \ + --header 'X-Auth-Token: API_TOKEN' \ --data-raw '{ "template_id": <%= current_account.templates.last&.id || 1 %>, "emails": "<%= current_user.email.sub('@', '+test@') %>, <%= current_user.email.sub('@', '+test2@') %>" @@ -108,7 +108,7 @@
<% text = capture do %>curl '<%= api_template_url(current_account.templates&.last || 1) %>' \ - --header 'X-Auth-Token: <%= current_user.access_token.token %>'<% end.to_str %> + --header 'X-Auth-Token: API_TOKEN'<% end.to_str %> <%= render 'shared/clipboard_copy', icon: 'copy', text:, class: 'btn btn-ghost text-white', icon_class: 'w-6 h-6 text-white', copy_title: t('copy'), copied_title: t('copied') %> diff --git a/config/routes.rb b/config/routes.rb index 1947b4b4..e90bd2f2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -170,6 +170,10 @@ Rails.application.routes.draw do resources :search_entries_reindex, only: %i[create] resources :sms, only: %i[index], controller: 'sms_settings' end + if Docuseal.demo? || !Docuseal.multitenant? + resources :api, only: %i[index create], controller: 'api_settings' + resource :reveal_access_token, only: %i[show create], controller: 'reveal_access_token' + end resources :email, only: %i[index create], controller: 'email_smtp_settings' resources :sso, only: %i[index], controller: 'sso_settings' resources :notifications, only: %i[index create], controller: 'notifications_settings' @@ -180,8 +184,6 @@ Rails.application.routes.draw do resources :integration_users, only: %i[index], path: 'users/:status', controller: 'users', defaults: { status: :integration } resource :personalization, only: %i[show create], controller: 'personalization_settings' - resources :api, only: %i[index create], controller: 'api_settings' - resource :reveal_access_token, only: %i[show create], controller: 'reveal_access_token' resources :webhooks, only: %i[index show new create update destroy], controller: 'webhook_settings' do post :resend