From 3f05fa91fe15c0fe51acc8ee1cd669368473e4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicole=20Miko=C5=82ajczyk?= Date: Sun, 25 May 2025 22:14:57 +0200 Subject: [PATCH] pl-api: fix for gts? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicole Mikołajczyk --- packages/pl-api/lib/client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pl-api/lib/client.ts b/packages/pl-api/lib/client.ts index 12e2b532c..e3ad10512 100644 --- a/packages/pl-api/lib/client.ts +++ b/packages/pl-api/lib/client.ts @@ -84,7 +84,7 @@ import { import { circleSchema } from './entities/circle'; import { type GroupedNotificationsResults, groupedNotificationsResultsSchema, type NotificationGroup } from './entities/grouped-notifications-results'; import { ShoutMessage, shoutMessageSchema } from './entities/shout-message'; -import { filteredArray } from './entities/utils'; +import { coerceObject, filteredArray } from './entities/utils'; import { AKKOMA, type Features, getFeatures, GOTOSOCIAL, ICESHRIMP_NET, MITRA, PIXELFED, PLEROMA } from './features'; import request, { getNextLink, getPrevLink, type RequestBody, type RequestMeta } from './request'; import { buildFullPath } from './utils/url'; @@ -1636,7 +1636,7 @@ class PlApiClient { response = await this.request('/api/v1/user').then(({ json }) => ({ settings: { enabled: !!json?.two_factor_enabled_at, - method: 'totp', + totp: !!json?.two_factor_enabled_at, }, })); break; @@ -1645,7 +1645,7 @@ class PlApiClient { } return v.parse(v.object({ - settings: v.object({ + settings: coerceObject({ enabled: v.boolean(), totp: v.boolean(), }),