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.
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/auth-js@0.0.0 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
Bug report
Describe the bug
As of v2.65.0 and b957c30, the
mfa.enrollfunction's return-type has changed, so that the following code in the official TOTP docs now throws a TypeScript error:https://github.com/supabase/supabase/blob/7f0a216c40dafdd14ae99b7a6efe4801e8306144/apps/docs/content/guides/auth/auth-mfa/totp.mdx?plain=1#L122-L133
To Reproduce
Add the following test to this repo:
Running the tests will then cause the following TypeScript error in v2.65.0, but not before v2.65.0:
Expected behavior
Either:
Existing code should still function when updated to v2.65.0. E.g. the
mfa.enrollfunction has types that say it never returns atype: "phone"whenfactorType: "totp"is passed. This could be done by using eitherIf this is not possible, at least updating the docs in https://github.com/supabase/supabase/blob/7f0a216c40dafdd14ae99b7a6efe4801e8306144/apps/docs/content/guides/auth/auth-mfa/totp.mdx?plain=1#L122-L133
Screenshots
N/A
System information
Additional context
N/A