This commit is contained in:
Shotaro Nakamura
2026-06-19 21:42:56 +09:00
parent b843a5ff38
commit 46f5856230
2 changed files with 2 additions and 1 deletions
@@ -49,6 +49,7 @@ export const listApiKeys = async (db: Db) =>
revokedAt: apiKeys.revokedAt, revokedAt: apiKeys.revokedAt,
}) })
.from(apiKeys) .from(apiKeys)
.where(isNull(apiKeys.revokedAt))
.orderBy(apiKeys.createdAt) .orderBy(apiKeys.createdAt)
export const createApiKey = async (db: Db, label: string, settings: ApiKeySettings = {}) => { export const createApiKey = async (db: Db, label: string, settings: ApiKeySettings = {}) => {
@@ -36,7 +36,7 @@ export const useAuthAdmin = () => {
const refresh = async (options?: { autoConnect?: boolean; connect?: () => void }) => { const refresh = async (options?: { autoConnect?: boolean; connect?: () => void }) => {
status.value = await getStatus() status.value = await getStatus()
if (status.value.authenticated) { if (status.value.authenticated) {
apiKeys.value = (await listApiKeys()).apiKeys apiKeys.value = (await listApiKeys()).apiKeys.filter((key) => !key.revokedAt)
sbiPasskeys.value = (await listSbiPasskeys()).passkeys sbiPasskeys.value = (await listSbiPasskeys()).passkeys
selectedPasskeyId.value ||= sbiPasskeys.value[0]?.id ?? '' selectedPasskeyId.value ||= sbiPasskeys.value[0]?.id ?? ''
if (options?.autoConnect && selectedPasskeyId.value) options.connect?.() if (options?.autoConnect && selectedPasskeyId.value) options.connect?.()