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
Hi, I've created an Android Cordova app based on an Angular 11 SPA. I am calling the signInSilent method from my SPA's HttpInterceptor to get a token to pass to my API. This usually works normally the first time, but then it starts randomly giving me an array as a response when invoked.
{
"token":"eyJ0eX000000...",
"account":{
"id":"00000000-0000-0000-0000-000000000000",
"username":"Missing from the token response",
"claims":[]
}
}
But then I randomly also receive this result:
[
{
"id":"00000000-0000-0000-0000-000000000000",
"username":"Missing from the token response",
"claims":[]
}
]
As you can see, first, it doesn't have a token; second, it is an array.
I keep my own cache of the token, so this is not a problem during the time that the token is valid, but as soon as it expires, if the next API call receives the array result, I end up passing the cached expired token to the API, and of course get a 401 Unauthorized error.
The most bizarre thing about this error is that when debugging the Java code using Android Studio, I noticed that the array result is being passed to my app's JavaScript callback, before the native code is invoked. So the native code produces the right authorization object, but it never gets to the app because the callback has already been triggered.
Has anyone experienced this error, and/or knows how I can solve it? Any ideas are welcome.
Thank you for your attention, and for this great library!
The text was updated successfully, but these errors were encountered:
Hi, I've created an Android Cordova app based on an Angular 11 SPA. I am calling the
signInSilent
method from my SPA's HttpInterceptor to get a token to pass to my API. This usually works normally the first time, but then it starts randomly giving me an array as a response when invoked.This is my configuration (I removed the API ID):
Normally I get this kind of result:
But then I randomly also receive this result:
As you can see, first, it doesn't have a token; second, it is an array.
I keep my own cache of the token, so this is not a problem during the time that the token is valid, but as soon as it expires, if the next API call receives the array result, I end up passing the cached expired token to the API, and of course get a
401 Unauthorized
error.The most bizarre thing about this error is that when debugging the Java code using Android Studio, I noticed that the array result is being passed to my app's JavaScript callback, before the native code is invoked. So the native code produces the right authorization object, but it never gets to the app because the callback has already been triggered.
Has anyone experienced this error, and/or knows how I can solve it? Any ideas are welcome.
Thank you for your attention, and for this great library!
The text was updated successfully, but these errors were encountered: