You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For IOS, we have been getting intermittent failures to login. You may go 50 logins without an issue and then have a failure or it could be one every other, or several in a row before working again. It will pop the Safari browser to login, enter in your credentials, then Safari goes away and then nothing happens. Nothing is received back from Auth0 as there is no transmission of data at all.
In troubleshooting this out, what is happening is a false value is being returned here:
In logging this line, when we were getting failures, there was an empty space in the string for one of the states, while the other one had a -. Moving further back in the code, the state value was coming in with a %20 where the space was at.
Basically the comparison of the state value was failing. In further tracing down why this was the case, I determined that the code here is the issue:
What is going on is the replace function as written will only every replace the first value in the string it comes across. So, every so often, there will end up multiple + signs in the state string. The replace function is only replacing the first + sign and leaving all subsequent plus signs in place. Here are some examples of the before and after.
Incidentally, it is doing this for each of the three replace functions, but the only time the %20 and subsequent empty character happens and causes the failure is when there are multiple + signs.
The fix is the change the replace functions to this:
For IOS, we have been getting intermittent failures to login. You may go 50 logins without an issue and then have a failure or it could be one every other, or several in a row before working again. It will pop the Safari browser to login, enter in your credentials, then Safari goes away and then nothing happens. Nothing is received back from Auth0 as there is no transmission of data at all.
In troubleshooting this out, what is happening is a
false
value is being returned here:nativescript-auth0/src/ios/authSession.ts
Lines 57 to 59 in 738de06
It's coming from a check done here:
nativescript-auth0/src/ios/authSession.ts
Lines 76 to 78 in 738de06
In logging this line, when we were getting failures, there was an empty space in the string for one of the states, while the other one had a
-
. Moving further back in the code, the state value was coming in with a%20
where the space was at.Basically the comparison of the
state
value was failing. In further tracing down why this was the case, I determined that the code here is the issue:nativescript-auth0/src/ios/utils.ts
Lines 25 to 28 in 738de06
What is going on is the
replace
function as written will only every replace the first value in the string it comes across. So, every so often, there will end up multiple+
signs in the state string. The replace function is only replacing the first+
sign and leaving all subsequent plus signs in place. Here are some examples of the before and after.Incidentally, it is doing this for each of the three replace functions, but the only time the
%20
and subsequent empty character happens and causes the failure is when there are multiple+
signs.The fix is the change the replace functions to this:
I'll have a PR in the next few hours.
Which platform(s) does your issue occur on?
Please, tell us how to recreate the issue in as much detail as possible.
Describe the steps to reproduce it.
Is there any code involved?
The text was updated successfully, but these errors were encountered: