enhance: OAuth2 (IndieAuth) でロゴが提供されている場合は表示するように (#15578)

* enhance: OAuthでロゴが提供されている場合は表示するように

* Update Changelog

* refactor

* fix

* fix test
This commit is contained in:
かっこかり
2025-03-06 17:05:14 +09:00
committed by GitHub
parent f7ea0c6991
commit 22228b6756
5 changed files with 75 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkAuthConfirm
ref="authRoot"
:name="name"
:icon="logo"
:permissions="permissions"
:waitOnDeny="true"
@accept="onAccept"
@@ -33,6 +34,7 @@ if (transactionIdMeta) {
}
const name = document.querySelector<HTMLMetaElement>('meta[name="misskey:oauth:client-name"]')?.content;
const logo = document.querySelector<HTMLMetaElement>('meta[name="misskey:oauth:client-logo"]')?.content;
const permissions = document.querySelector<HTMLMetaElement>('meta[name="misskey:oauth:scope"]')?.content.split(' ').filter((p): p is typeof Misskey.permissions[number] => (Misskey.permissions as readonly string[]).includes(p)) ?? [];
function doPost(token: string, decision: 'accept' | 'deny') {