use of com.auth0.android.provider.AuthCallback in project chefly_android by chef-ly.
the class MainActivity method socialLogin.
private void socialLogin(String connection) {
// getString(R.string.auth0_domain
Auth0 auth0 = new Auth0(getString(R.string.auth0_client_id), getString(R.string.auth0_domain));
WebAuthProvider.init(auth0).withConnection(connection).start(MainActivity.this, new AuthCallback() {
@Override
public void onFailure(@NonNull Dialog dialog) {
dialog.show();
}
@Override
public void onFailure(final AuthenticationException exception) {
// Show error to the user
runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d(TAG, "LOGIN FAIL");
String errorMsg = "Sign in request failed";
showToast(errorMsg);
}
});
}
@Override
public void onSuccess(@NonNull Credentials credentials) {
// Navigate to your next activity
startRecipeListActivity("aaa");
}
});
}
Aggregations