private fun login() {
WebAuthProvider
.login(account)
.withScheme(getString(R.string.com_auth0_scheme))
.withScope(getString(R.string.login_scopes))
.withAudience(getString(R.string.login_audience, getString(R.string.com_auth0_domain)))
.start(this, object : Callback<Credentials, AuthenticationException> {
override fun onFailure(exception: AuthenticationException) {
showSnackBar(getString(R.string.login_failure_message, exception.getCode()))
}
override fun onSuccess(credentials: Credentials) {
cachedCredentials = credentials
showSnackBar(getString(R.string.login_success_message, credentials.accessToken))
updateUI()
showUserProfile()
}
})
}
the error is : The corresponding parameter in the supertype ‘Callback’ is named ‘error’. This may cause problems when calling this function with named arguments.
Also :
private fun showUserProfile() {
// Guard against showing the profile when no user is logged in
if (cachedCredentials == null) {
return
}
val client = AuthenticationAPIClient(account)
client
.userInfo(cachedCredentials!!.accessToken!!)
.start(object : Callback<UserProfile, AuthenticationException> {
override fun onFailure(exception: AuthenticationException) {
showSnackBar(getString(R.string.general_failure_with_exception_code,
exception.getCode()))
}
override fun onSuccess(profile: UserProfile) {
cachedUserProfile = profile
updateUI()
}
})
}
the warning is :Unnecessary non-null assertion (!!) on a non-null receiver of type String
I got these errors duplicated all over the code !
Thank you in advance for you help