supabase-js icon indicating copy to clipboard operation
supabase-js copied to clipboard

feat(auth): add optional jwt parameter to getAuthenticatorAssuranceLevel

Open 7ttp opened this issue 2 months ago • 0 comments

Summary

Adds an optional jwt parameter to mfa.getAuthenticatorAssuranceLevel(), enabling it to work in server side environments like Edge Functions where no session is stored.

Problem

In Edge Functions, getAuthenticatorAssuranceLevel() always returns { currentLevel: null, nextLevel: null, currentAuthenticationMethods: [] } because it relies on getSession() which reads from storage. Edge Functions don't have a stored session, only the JWT from the Authorization header.

Solution

Added an optional jwt parameter following the same pattern as getUser(jwt?):

closes https://github.com/supabase/supabase-js/issues/1677

7ttp avatar Dec 11 '25 11:12 7ttp