Closed nourski closed 1 year ago
Was able to figure out the issue and solution in case anyone else runs into this:
Had to go the custom storage route and deserialize the stored string when retrieving the value. I.e.:
class CustomStorage extends CognitoStorage {
...
@override
Future getItem(String key) async {
final value = await _storage.read(key: key);
return value?.replaceAll('"', '');
}
...
}
I have enabled remembering device to suppress MFA. It seems to be working really well except the device key seems to change every time the app is closed and reopened which means MFA is re-triggered every time the app is opened which defeats the purpose of remembering the device.
Please see attached device logs from Cognito for reference. I noticed that if I logout and log back in without restarting the app, the same device token is maintained, it only seems to regenerate when the app is freshly opened.