auth0.webAuth.authorize sometimes does not resolve and hangs
See original GitHub issueDescribe the problem
We have a login screen that has a “Login” button on it, when you press the button it fires the following codes:
const auth0 = new Auth0({ domain, clientId });
function onPress () {
// hangs in here forever
const credentials = await auth0.webAuth.authorize(
{
scope:
'openid profile email read:current_user offline_access',
connection: 'Username-Password-Authentication'
},
{
ephemeralSession: true
}
);
// doesn't get executed
console.log(credentials);
}
For some unknown reasons, After the user has logged in, the login page just gets stuck there but I can see “successful login” on the logs, the callee just doesn’t return to the caller, so I don’t see the console log, I also don’t see any errors or any logs at all.
It only happens on android, in ios it works fine, I’m thinking that it has something to do with the configuration rather than the code itself?
What was the expected behavior?
I expect the promise to resolve.
Reproduction
- Step 1…
- Step 2…
- …
Not really sure how to replicate it, although we do have two accounts, the device originally uses account1
it has been using that for a while, then we switched to account2
, that’s when this happened, I have uninstalled the app, cleared data, ./gradlew clean
, etc.
Environment
- Version of this library used: 2.7.0
- Which framework are you using, if applicable: n/a
- Other modules/plugins/libraries that might be involved: n/a
- Any other relevant information you think would be useful: All given above
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
That doesn’t seem right, because according to the docs: https://developer.android.com/studio/build/manifest-build-variables
EDIT:
I think I got it, it only resolves to this when using it in the manifest itself, but since auth0 is using
${auth0Scheme}
it won’t work. Unfortunately doingauth0Scheme: "${applicationId}"
results tocom.myappnull
when I look at it in the merged manifest.Aha, that solved it, I forgot to change the
android:host
.Thanks for the kind resposne 🙇🏻