I have an expo app that I am trying to use auth0 to log in on android. We have also created the app for iOS and it is able to log in and work. The error I’m getting is like the one in this ticket:
(Can’t include links, so just referencing the name of the other ticket)
no-credentials-were-previously-set-error-with-android-sdk/137419
However, calling hasValidCredentials does not resolve the fact that the credentials aren’t being populated. Here is the code:
const onLogin = async () => {
try {
console.log("authorizing");
setIsLoading(true);
await authorize(
{
scope: ENV.AUTH0_SCOPE,
audience: ENV.AUTH0_AUDIENCE,
},
{
useLegacyCallbackUrl: true,
},
).then(() => {
console.log("authorized");
auth0_instance.credentialsManager
.hasValidCredentials()
.then((hasValidCredentials) => {
console.log("hasValidCredentials", hasValidCredentials);
})
.catch((err) => {
console.log("hasValidCredentials error", err);
});
auth0_instance.credentialsManager
.getCredentials()
.then(async (credentials) => {
console.log("credentials", credentials);
})
.catch((err) => {
console.log("credentials error", err);
});
});
} catch (err) {
showAlert(err);
} finally {
setIsLoading(false);
}
};
When this runs: the following debug output occurs:
LOG authorizing
LOG authorized
LOG hasValidCredentials false
LOG credentials error [Error: No Credentials were previously set.]
As stated before, iOS works fine, and I believe the callback url info is set properly because if I legimitately make the the domain or schema wrong, there is an error when the login experience appears immediately.
Any assistance is appreciated.