For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.
aal1 refers to having the 1st factor of authentication such as an email and password or OAuth sign-in while aal2 refers to the 2nd factor of authentication such as a time-based, one-time-password (TOTP).nextLevel field will return aal2, else, it will return the current level.nextLevel includes factors enrolled on other devices.AuthError of kind .sessionMissing.let aal = try await supabase.auth.mfa.assuranceLevel()
let currentLevel = aal.currentLevel
let nextLevel = aal.nextLevel
let currentAuthenticationMethods = aal.currentAuthenticationMethods
do {
let aal = try await supabase.auth.mfa.assuranceLevel()
if aal.nextLevel != aal.currentLevel {
// Show the MFA prompt.
}
} catch let error as AuthError where error.kind == .sessionMissing {
// Show the sign-in screen.
}