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()
.val factor = supabase.gotrue.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.gotrue.mfa.verifiedFactors
val verifiedFactors = supabase.gotrue.mfa.retrieveFactorsForCurrentUser()