deleteFactor
Deletes an authentication factor from the current user's account. The endpoint called depends on the type of the AuthenticationFactor passed:
AuthenticationFactor.TOTP →
DELETE /sdk/v1/users/totps/{totp_id}AuthenticationFactor.Email →
DELETE /sdk/v1/users/emails/{email_id}AuthenticationFactor.OAuth →
DELETE /sdk/v1/users/oauth/{oauth_user_registration_id}AuthenticationFactor.WebAuthn →
DELETE /sdk/v1/users/webauthn_registrations/{webauthn_registration_id}AuthenticationFactor.Biometric →
DELETE /sdk/v1/users/biometric_registrations/{biometric_registration_id}AuthenticationFactor.CryptoWallet →
DELETE /sdk/v1/users/crypto_wallets/{crypto_wallet_id}AuthenticationFactor.PhoneNumber →
DELETE /sdk/v1/users/phone_numbers/{phone_id}
Kotlin:
StytchConsumer.user.deleteFactor(
AuthenticationFactor.Email(factorId = "email-test-d5a3b680-e8a3-40c0-b815-ab79986666d0")
)iOS:
let factor = AuthenticationFactor.Email(factorId: "email-test-d5a3b680-e8a3-40c0-b815-ab79986666d0")
let response = try await StytchConsumer.user.deleteFactor(factor)React Native:
StytchConsumer.user.deleteFactor({ type: "email", factorId: "email-test-d5a3b680-e8a3-40c0-b815-ab79986666d0" })Return
DeleteFactorResponse containing the updated user object after the factor was removed.
Parameters
AuthenticationFactor sealed class identifying the factor to delete. The
factorIdis the unique ID of the specific factor registration (e.g. the email ID or phone number ID).
Throws
if the factor does not exist or the request fails.
if the coroutine is cancelled.