After the successful sign-up or sign-in on iOS/Android, we get a callback from SDK with Credentials as method param. We have a use case to trigger registration success or login success event for both email/password and social login depending on user is a new or existing user. Is there a way to identify if the user is new or existing after the successful authentication using SDK?
-
Which SDK this is regarding:
iOS and Android SDK -
SDK Version:
NA -
Platform Version:
NA -
Code Snippets/Error Messages/Supporting Details/Screenshots:
private fun loginWithBrowser() {
// Setup the WebAuthProvider, using the custom scheme and scope.
WebAuthProvider.login(account)
.withScheme(getString(R.string.com_auth0_scheme))
.withScope(“openid profile email read:current_user update:current_user_metadata”)
.withAudience(“https://${getString(R.string.com_auth0_domain)}/api/v2/”)// Launch the authentication passing the callback where the results will be received .start(this, object : Callback<Credentials, AuthenticationException> { override fun onFailure(exception: AuthenticationException) { showSnackBar("Failure: ${exception.getCode()}") } override fun onSuccess(credentials: Credentials) { cachedCredentials = credentials showSnackBar("Success: ${credentials.accessToken}") Log.d("token", credentials.accessToken) updateUI() showUserProfile() } })
}