Callback on Completetion of all Challenges
✅ If All Challenges Pass
When all required onboarding steps complete (e.g., OTP, National ID):
- The SDK considers the user successfully onboarded.
- Then it calls
getUser
to: -
- Begin a new authenticated session.
- Prepare the app to prompt for login again (especially useful in multi-user environments).
- Reset the session state for secure continuity.
❌ If Any Challenge Fails
When the user fails any challenge (e.g., max OTP retries):
- The SDK resets the session workflow.
- It emits the
getUser
event again so the app can- allow user switch
- retry onboarding.
🧠 Developer Tip
In your handler for getUser
, add logic to detect whether onboarding was completed or failed, for example:
if (userPreviouslyOnboarded) {
showLoginScreen();
} else {
showOnboardingFlow();
}
Use currentWorkflow
, stored flags, or custom user session state to guide behavior.
📚 This behavior ensures a clean restartable state for both successful and failed onboarding scenarios.
Updated 3 months ago