dawarich/app/views/devise/registrations/_api_key.html.erb
2025-05-02 20:05:12 +02:00

18 lines
862 B
Text

<p class="py-6">
<p class='py-2'>Use this API key to authenticate your requests.</p>
<code><%= current_user.api_key %></code>
<p class='py-2'>
<p>Docs: <%= link_to "API documentation", '/api-docs', class: 'underline hover:no-underline' %></p>
<h3 class='text-xl font-bold mt-4'>Usage examples</h3>
<h3 class='text-lg font-bold mt-4'>OwnTracks</h3>
<p><code><%= api_v1_owntracks_points_url(api_key: current_user.api_key) %></code></p>
<h3 class='text-lg font-bold mt-4'>Overland</h3>
<p><code><%= api_v1_overland_batches_url(api_key: current_user.api_key) %></code></p>
</p>
<p class='py-2'>
<%= link_to "Generate new API key", generate_api_key_path, data: { confirm: "Are you sure? This will invalidate the current API key.", turbo_confirm: "Are you sure?", turbo_method: :post }, class: 'btn btn-primary' %>
</p>
</p>