oktadev/schematics

Okta - failure in SecureStorage remove issue on logout- ionic cordova app on iOS

ahamedpeer opened this issue · 4 comments

we are getting below error when logging out from app.

Unhandled Promise rejection: Failure in SecureStorage.remove() - The specified item could not be found in the keychain ; Zone: ; Task: Promise.then ; Value: Error: Failure in SecureStorage.remove() - The specified item could not be found in the keychain fail@ionic://localhost/plugins/cordova-plugin-secure-storage-echo/www/securestorage.js:42:45 callbackFromNative@ionic://localhost/cordova.js:297:57 @Ionic://localhost/plugins/cordova-plugin-ionic-webview/src/www/ios/ios-wkwebview-exec.js:129:35 @Ionic://localhost/polyfills.js:173:53 @Ionic://localhost/polyfills.js:1331:41 @Ionic://localhost/polyfills.js:218:61 drainMicroTaskQueue@ionic://localhost/polyfills.js:633:46 promiseReactionJob@[native code]
try { newFunc.apply(console, args); } catch (e) {}
};
}
// ------------------------------------------------------------------------------
// For every function that exists in the original console object, that
// also exists in the new console object, wrap the new console method
// with one that calls both
// ------------------------------------------------------------------------------
for (var key in console) {
   if (typeof WinConsole[key] === 'function') {
       console[key] = wrappedOrigCall(WinConsole[key], console[key]);
  }
}
});
// file: ../cordova-ios/cordova-js-src/plugin/ios/launchscreen.js
define("cordova/plugin/ios/launchscreen", function(require, exports, module) {
var exec = require('cordova/exec');
var launchscreen = {
   show: function () {
       exec(null, null, 'LaunchScreen', 'show', []);
  },
   hide: function () {
       exec(null, null, 'LaunchScreen', 'hide', []);
  }
};
module.exports = launchscreen;
Resource
Scope Chain
Type
MIME Type text/javascript
Resource Type Script
Location
Full URL ionic://localhost/cordova.js
Scheme ionic
Host localhost
Path /cordova.js
Filename cordova.js
Request & Response
Method —
Protocol —
Priority —
Cached No
Status —
Code —
Error
IP Address —
Connection ID

When we try to re-login,(It might be setting the token in secure storage again) it throws exception and couldn't proceed with the app again.

_[Log] sign In (cordova.js, line 1413, x2)
[Log] Checking to see if there is an authorization response to be delivered. (cordova.js, line 1413)
[Error] ERROR
Error: Uncaught (in promise): Error: advanced-http: "data" option is configured to support only following data types: Array, Object processData@ionic://localhost/plugins/cordova-plugin-advanced-http/www/helpers.js:418:22 sendRequest@ionic://localhost/plugins/cordova-plugin-advanced-http/www/public-interface.js:178:28 post@ionic://localhost/plugins/cordova-plugin-advanced-http/www/public-interface.js:200:39 @Ionic://localhost/vendor.js:2824:45 @Ionic://localhost/vendor.js:2784:25 ZoneAwarePromise@ionic://localhost/polyfills.js:1353:41 tryNativePromise@ionic://localhost/vendor.js:2783:31 wrapPromise@ionic://localhost/vendor.js:2807:23 @Ionic://localhost/vendor.js:23678:77 generatorResume@[native code] @Ionic://localhost/vendor.js:30934:75 ZoneAwarePromise@ionic://localhost/polyfills.js:1353:41 _awaiter@ionic://localhost/vendor.js:30930:36 generatorResume@[native code] fulfilled@ionic://localhost/vendor.js:30931:62 onInvoke@ionic://localhost/vendor.js:112176:31 @Ionic://localhost/polyfills.js:173:53 @Ionic://localhost/polyfills.js:1331:41 onInvokeTask@ionic://localhost/vendor.js:112164:35 @Ionic://localhost/polyfills.js:218:61 drainMicroTaskQueue@ionic://localhost/polyfills.js:633:46 promiseReactionJob@[native code]
resolvePromise — zone.js:1255
(anonymous function) — zone.js:1162
rejected — tslib:72:89
onInvoke — core.mjs:25476
(anonymous function) — zone.js:160
(anonymous function) — zone.js:1318
onInvokeTask — core.mjs:25463
(anonymous function) — zone.js:205
drainMicroTaskQueue — zone.js:620

Are you using Cordova or Capacitor with Ionic? Did you create a brand new app and install OktaDev Schematics or how did you create it? In order to help you fix this problem, I need to be able to reproduce it. If you can help me do that, it should be a lot easier to fix.

Yes, I'm using Ionic 5 brand new app(tabs template angular based) with cordova and used @oktadev/schematics for okta integration.

Do you have the option to use Capacitor instead?

Closing due to lack of response.