fixes #2166
This commit is contained in:
19
app/views/api_keys/new.html.erb
Normal file
19
app/views/api_keys/new.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<div id="c-api-keys">
|
||||
<div id="a-new">
|
||||
<h1>New API Key</h1>
|
||||
|
||||
<p>You can generate a new API key to authenticate against <%= Danbooru.config.app_name %>.</p>
|
||||
|
||||
<%= error_messages_for :api_key %>
|
||||
|
||||
<%= simple_form_for(@api_key) do |f| %>
|
||||
<%= submit_tag "Generate" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "users/secondary_links" %>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
New API Key - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
@@ -131,7 +131,13 @@
|
||||
<% if CurrentUser.user.id == user.id %>
|
||||
<tr>
|
||||
<th>API Key</th>
|
||||
<td><%= CurrentUser.user.bcrypt_cookie_password_hash %></td>
|
||||
<td>
|
||||
<% if CurrentUser.user.api_key %>
|
||||
<%= CurrentUser.user.api_key.key %>
|
||||
<% else %>
|
||||
<%= link_to "Generate key", new_api_key_path %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user