deleteFactor

Deletes an authentication factor from the current user's account. The endpoint called depends on the type of the AuthenticationFactor passed:

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

factor
  • AuthenticationFactor sealed class identifying the factor to delete. The factorId is the unique ID of the specific factor registration (e.g. the email ID or phone number ID).

Throws

StytchError

if the factor does not exist or the request fails.

if the coroutine is cancelled.