From c239a0830ee77e51c61424a672502faff75097da Mon Sep 17 00:00:00 2001 From: Supun Sudaraka Date: Mon, 28 Oct 2024 23:03:02 +0530 Subject: [PATCH] added the auth.mfa.listFactors() method to @supabase/supabase-js sdk reference doc --- .../spec/common-client-libs-sections.json | 9 +++- apps/docs/spec/supabase_js_v2.yml | 53 +++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/apps/docs/spec/common-client-libs-sections.json b/apps/docs/spec/common-client-libs-sections.json index 970e6dec100..f3da93d67df 100644 --- a/apps/docs/spec/common-client-libs-sections.json +++ b/apps/docs/spec/common-client-libs-sections.json @@ -677,6 +677,13 @@ "product": "auth", "type": "function" }, + { + "id": "mfa-list-factors", + "title": "List factors", + "slug": "auth-mfa-listfactors", + "product": "auth", + "type": "function" + }, { "id": "mfa-get-authenticator-assurance-level", "title": "Get Authenticator Assurance Level", @@ -749,7 +756,7 @@ "type": "function" }, { - "id": "mfa-list-factors", + "id": "mfa-list-factors-admin", "title": "List all factors for a user", "slug": "auth-admin-mfa-listfactors", "product": "auth-admin", diff --git a/apps/docs/spec/supabase_js_v2.yml b/apps/docs/spec/supabase_js_v2.yml index 294008954d6..77f8fd9497c 100644 --- a/apps/docs/spec/supabase_js_v2.yml +++ b/apps/docs/spec/supabase_js_v2.yml @@ -2420,6 +2420,59 @@ functions: error: null } ``` + - id: mfa-list-factors + title: 'mfa.listFactors()' + $ref: '@supabase/auth-js.GoTrueMFAApi.listFactors' + examples: + - id: list-all-enrolled-factors + name: List all enrolled factors + isSpotlight: true + code: | + ```js + const { data, error } = await supabase.auth.mfa.listFactors() + ``` + response: | + ```json + { + data: { + all: [{ + id: '', + friendly_name: 'Auth App Factor', + factor_type: 'totp', + status: 'verified', + created_at: '2024-01-01T00:00:00Z', + updated_at: '2024-01-01T00:00:00Z' + }, { + id: '', + friendly_name: 'Auth Phone Factor', + factor_type: 'phone', + phone: '', + status: 'verified', + created_at: '2024-01-01T00:00:00Z', + updated_at: '2024-01-01T00:00:00Z' + }], + totp: [{ + id: '', + friendly_name: 'Auth App Factor', + factor_type: 'totp', + status: 'verified', + created_at: '2024-01-01T00:00:00Z', + updated_at: '2024-01-01T00:00:00Z' + }], + phone: [{ + id: '', + friendly_name: 'Auth Phone Factor', + factor_type: 'phone', + phone: '', + status: 'verified', + created_at: '2024-01-01T00:00:00Z', + updated_at: '2024-01-01T00:00:00Z' + }] + }, + error: null + } + ``` + - id: admin-api title: 'Overview' notes: |