supabase-js
supabase-js copied to clipboard
feat(auth): add optional jwt parameter to getAuthenticatorAssuranceLevel
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