You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
mfa.enroll's return type has a TypeScript breaking change in v2.65.0 #955
As of v2.65.0 and b957c30, the mfa.enroll function's return-type has changed, so that the following code in the official TOTP docs now throws a TypeScript error:
Running the tests will then cause the following TypeScript error in v2.65.0, but not before v2.65.0:
> @supabase/[email protected] test:suite
> jest --runInBand
FAIL test/GoTrueClient.test.ts
● Test suite failed to run
test/GoTrueClient.test.ts:917:17 - error TS2339: Property 'totp' does not exist on type '{ id: string; type: "totp"; totp: { qr_code: string; secret: string; uri: string; }; friendly_name?: string | undefined; } | { id: string; type: "phone"; friendly_name?: string | undefined; phone: string; }'.
Property 'totp' does not exist on type '{ id: string; type: "phone"; friendly_name?: string | undefined; phone: string; }'.
917 expect(data.totp.qr_code).not.toBeNull()
Expected behavior
Either:
Existing code should still function when updated to v2.65.0. E.g. the mfa.enroll function has types that say it never returns a type: "phone" when factorType: "totp" is passed. This could be done by using either
Activity
fix: improve `mfa.enroll` return types (#956)