diff --git a/app/views/devise/registrations/_api_key.html.erb b/app/views/devise/registrations/_api_key.html.erb new file mode 100644 index 00000000..5397a1fd --- /dev/null +++ b/app/views/devise/registrations/_api_key.html.erb @@ -0,0 +1,11 @@ +

+

Use this API key to authenticate your requests.

+ <%= current_user.api_key %> +

+ Usage example: +

<%= api_v1_points_url(api_key: current_user.api_key) %>

+

+

+ <%= link_to "Generate new API key", generate_api_key_path, data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?", turbo_method: :post }, class: 'btn btn-primary' %> +

+

diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 7a2f8630..8e0968fb 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -2,17 +2,7 @@

Edit your account!

-

-

Use this API key to authenticate your requests.

- <%= current_user.api_key %> -

- Usage example: -

<%= api_v1_points_url(api_key: current_user.api_key) %>

-

-

- <%= link_to "Generate new API key", generate_api_key_path, data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?", turbo_method: :post }, class: 'btn btn-primary' %> -

-

+ <%#= render 'devise/registrations/api_key' %>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), class: 'form-body', html: { method: :put }) do |f| %>