Enrolls a new factor.
totp
is the only supported factorType
. The returned id
should be used to create a challenge.mfa.createChallenge()
.mfa.verifyChallenge()
.mfa.createChallengeAndVerify()
.The type of MFA factor to enroll. Currently only supports `FactorType.TOTP`.
Domain which the user is enrolling with.
Human readable name assigned to a device.
val factor = supabase.auth.mfa.enroll(factorType = FactorType.TOTP)
// Use the id to create a challenge.
// The challenge can be verified by entering the code generated from the authenticator app.
// The code will be generated upon scanning the qr_code or entering the secret into the authenticator app.
val (id, type, qrCode) = factor.data //qrCode is a svg as a string
val (factorId, factorType, _) = factor
val verifiedFactors = supabase.auth.mfa.verifiedFactors
val verifiedFactors = supabase.auth.mfa.retrieveFactorsForCurrentUser()