Skip to content

Commit

Permalink
🎨 Improve API Token authentication #10792
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Mar 29, 2024
1 parent c0a10ab commit fa502ef
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/appearance/langs/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
"about11": "Network serving",
"about12": "After enabling, other devices in the same LAN will be allowed to access. The application will be closed automatically after modification, please restart manually",
"about13": "API token",
"about14": "The token needs to be authenticated when calling the API",
"about14": "The token needs to be authenticated when calling the API<br>HTTP request header <code class=\"fn__code\">Authorization: token ${token}</code>",
"about17": "Do not enable proxy when set to <code class='fn__code'>Direct connection</code>",
"about18": "When using a non-loopback address (<code class=\"fn__code\">127.0.0.1</code>/<code class=\"fn__code\">[::1]</code>) please set the Access authorization code first",
"checkUpdate": "Check update",
Expand Down
2 changes: 1 addition & 1 deletion app/appearance/langs/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
"about11": "Red de servicio",
"about12": "Después de habilitarlo, se permitirá el acceso a otros dispositivos de la misma LAN. La aplicación se cerrará automáticamente después de la modificación, por favor reinicie manualmente",
"about13": "Token API",
"about14": "El token debe ser autentificado al llamar a la API",
"about14": "El token debe ser autentificado al llamar a la API<br>Encabezado de solicitud HTTP <code class=\"fn__code\">Authorization: token ${token}</code>",
"about17": "No habilite el proxy cuando esté configurado como <code class='fn__code'>Conexión directa</code>",
"about18": "Cuando se utiliza una dirección sin bucle invertido (<code class=\"fn__code\">127.0.0.1</code>/<code class=\"fn__code\">[::1]</code> ) Primero configure el Código de autorización de acceso",
"checkUpdate": "Comprobar actualización",
Expand Down
2 changes: 1 addition & 1 deletion app/appearance/langs/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
"about11": "Service de réseau",
"about12": "Après l'activation, les autres appareils du même réseau local seront autorisés à accéder. L'application sera fermée automatiquement après modification, veuillez la redémarrer manuellement.",
"about13": "API token",
"about14": "Le token doit être authentifié lors de l'appel de l'API.",
"about14": "Le token doit être authentifié lors de l'appel de l'API<br>En-tête de requête HTTP <code class=\"fn__code\">Authorization: token ${token}</code>",
"about17": "N'activez pas le proxy lorsqu'il est défini sur <code class='fn__code'>Connexion directe</code>.",
"about18": "Lors de l'utilisation d'une adresse sans bouclage (<code class=\"fn__code\">127.0.0.1</code>/<code class=\"fn__code\">[::1]</code> ) Veuillez d'abord définir le Accès code d'autorisation",
"checkUpdate": "Vérifier la mise à jour",
Expand Down
2 changes: 1 addition & 1 deletion app/appearance/langs/zh_CHT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
"about11": "網路伺服",
"about12": "啟用後將允許同一區域網內的其他設備進行存取。修改後會自動關閉應用,請手動重啟",
"about13": "API token",
"about14": "調用 API 時需要通過該 token 進行鑒權",
"about14": "調用 API 時需要通過該 token 進行鑒權<br>HTTP 請求標頭 <code class=\"fn__code\">Authorization: token ${token}</code>",
"about17": "設置為 <code class='fn__code'>直接連接</code> 時不啟用代理",
"about18": "使用非環回地址(<code class=\"fn__code\">127.0.0.1</code>/<code class=\"fn__code\">[::1]</code>)時請先設置訪問授權碼",
"checkUpdate": "檢查更新",
Expand Down
2 changes: 1 addition & 1 deletion app/appearance/langs/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
"about11": "网络伺服",
"about12": "启用后将允许同一局域网内的其他设备进行访问。修改后会自动关闭应用,请手动重启",
"about13": "API token",
"about14": "调用 API 时需要通过该 token 进行鉴权",
"about14": "调用 API 时需要通过该 token 进行鉴权<br>HTTP 请求标头 <code class=\"fn__code\">Authorization: token ${token}</code>",
"about17": "设置为 <code class='fn__code'>直接连接</code> 时不启用代理",
"about18": "使用非环回地址(<code class=\"fn__code\">127.0.0.1</code>/<code class=\"fn__code\">[::1]</code>)时请先设置 访问授权码",
"checkUpdate": "检查更新",
Expand Down
2 changes: 1 addition & 1 deletion app/src/config/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const about = {
<div class="fn__flex config__item b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.about13}
<div class="b3-label__text">${window.siyuan.languages.about14}</div>
<div class="b3-label__text">${window.siyuan.languages.about14.replace("${token}", window.siyuan.config.api.token)}</div>
</div>
<span class="fn__space"></span>
<input class="b3-text-field fn__flex-center fn__size200" id="token" value="${window.siyuan.config.api.token}">
Expand Down
2 changes: 1 addition & 1 deletion app/src/mobile/settings/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const initAbout = () => {
<svg><use xlink:href="#iconCopy"></use></svg>${window.siyuan.languages.copy}
</button>
</div>
<div class="b3-label__text">${window.siyuan.languages.about14}</div>
<div class="b3-label__text">${window.siyuan.languages.about14.replace("${token}", window.siyuan.config.api.token)}</div>
</div>
<div class="b3-label">
<div class="config-about__logo">
Expand Down

0 comments on commit fa502ef

Please sign in to comment.