Replace "access token" with "API Key" (#3960) [ci skip]
This commit is contained in:
parent
1a99e9bf1a
commit
3a0dc13fc7
3 changed files with 15 additions and 15 deletions
|
|
@ -9,7 +9,7 @@ class ApiSecretsController < ApplicationController
|
|||
@secret.user_id = current_user.id
|
||||
|
||||
if @secret.save
|
||||
flash[:notice] = "Your access token has been generated: #{@secret.secret}"
|
||||
flash[:notice] = "Your API Key has been generated: #{@secret.secret}"
|
||||
else
|
||||
flash[:error] = @secret.errors.full_messages.to_sentence
|
||||
end
|
||||
|
|
@ -21,7 +21,7 @@ class ApiSecretsController < ApplicationController
|
|||
authorize @secret
|
||||
|
||||
if @secret.destroy
|
||||
flash[:notice] = "Your access token has been revoked."
|
||||
flash[:notice] = "Your API Key has been revoked."
|
||||
else
|
||||
flash[:error] = "An error occurred. Please try again or send an email to: yo@dev.to"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,22 +16,22 @@
|
|||
<hr />
|
||||
<% end %>
|
||||
|
||||
<h2>DEV API Access Tokens</h2>
|
||||
<p>You can generate personal access tokens to use for authentication with the DEV API. The API is still in early beta though. The <a href="/api">DEV API documentation</a> contains further information.</a></p>
|
||||
<h3>Generate an access token</h3>
|
||||
<h2>DEV API Keys</h2>
|
||||
<p>You can generate personal API keys to use for authentication with the DEV API. The API is still in early beta though. The <a href="/api">DEV API documentation</a> contains further information.</a></p>
|
||||
<h3>Generate a new Key</h3>
|
||||
<%= form_tag users_api_secrets_path, method: :post do %>
|
||||
<%= fields_for :api_secret do |api_secret| %>
|
||||
<div class="field">
|
||||
<%= api_secret.label(:description, "Token Description") %>
|
||||
<%= api_secret.text_field(:description, placeholder: "What's this token for?", required: true) %>
|
||||
<%= api_secret.label(:description, "Description") %>
|
||||
<%= api_secret.text_field(:description, placeholder: "What's this API key for?", required: true) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<button class="big-action cta" id="new__api__secret__btn" type="submit">
|
||||
Generate Token
|
||||
Generate API Key
|
||||
</button>
|
||||
<% end %>
|
||||
|
||||
<h3>Active access tokens (Never share these secrets!)</h3>
|
||||
<h3>Active API keys (never share these!)</h3>
|
||||
<% if @user.api_secrets.empty? %>
|
||||
<p>None yet!</p>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -25,19 +25,19 @@ components:
|
|||
API Key authentication.
|
||||
|
||||
Authentication for some endpoints, like write operations on the
|
||||
Articles API require an API key (DEV API access token).
|
||||
Articles API require a DEV API key.
|
||||
|
||||
### Getting an API key
|
||||
|
||||
To obtain one, please follow these steps:
|
||||
|
||||
- visit https://dev.to/settings/account
|
||||
- in the "DEV API Access Tokens" section create a new token by adding a
|
||||
description and clicking on "Generate Token"
|
||||
- in the "DEV API Keys" section create a new key by adding a
|
||||
description and clicking on "Generate API Key"
|
||||
|
||||

|
||||
- You'll see the newly generated token in the same view
|
||||

|
||||

|
||||
- You'll see the newly generated key in the same view
|
||||

|
||||
name: api-key
|
||||
in: header
|
||||
oauth2:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue