Skip to content

Commit

Permalink
Fix: settings - hide API token by default
Browse files Browse the repository at this point in the history
  • Loading branch information
fs5m8 committed Jan 5, 2023
1 parent 4cd05ed commit 7e0d6a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,7 @@ common/views/components/media-image.vue:
sensitive: "NSFW"
click-to-show: "Click to show"
common/views/components/api-settings.vue:
show-token: "Show API Token"
intro: "To access the API, set this token as the key 'i' of request parameters."
caution: "Do not enter this token to any apps nor tell this token to others otherwise your account may get compromised."
regeneration-of-token: "If your token gets leaked, you can regenerate it."
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,7 @@ common/views/components/media-image.vue:
click-to-show: "クリックして表示"

common/views/components/api-settings.vue:
show-token: "APIトークンを表示"
intro: "API を利用するには、上記のトークンを i というキーでパラメータに付加してリクエストします。"
caution: "アカウントを不正利用される可能性があるため、このトークンは第三者に教えないでください(アプリなどにも入力しないでください)。"
regeneration-of-token: "万が一このトークンが漏れたりその可能性がある場合は、トークンを再生成できます。"
Expand Down
9 changes: 6 additions & 3 deletions src/client/app/common/views/components/settings/api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
<template #title><fa icon="key"/> API</template>

<section class="fit-top">
<ui-input :value="$store.state.i.token" readonly>
<span>{{ $t('token') }}</span>
</ui-input>
<details>
<summary>{{ $t('show-token') }}</summary>
<ui-input :value="$store.state.i.token" readonly>
<span>{{ $t('token') }}</span>
</ui-input>
</details>
<p>{{ $t('intro') }}</p>
<ui-info warn>{{ $t('caution') }}</ui-info>
<p>{{ $t('regeneration-of-token') }}</p>
Expand Down

0 comments on commit 7e0d6a4

Please sign in to comment.