JavaScript: regenerate

Replaces the user's recovery codes with a brand new set. All remaining codes from the previous set stop working immediately. The new plaintext codes are returned exactly once.

Requires auth.experimental.recoveryCodes: true.

Examples

Regenerate recovery codes

const { data, error } = await supabase.auth.mfa.recoveryCodes.regenerate()