auth0/SimpleKeychain

Crash on setData Auth0.Profile

Closed this issue · 2 comments

Using this
keychain.setData(NSKeyedArchiver.archivedDataWithRootObject(profile), forKey: "profile")
from the Auth0 documentation: https://auth0.com/docs/quickstart/native/ios-swift/03-session-handling#validate-an-existent-idtoken

The application is crashing and returning this:
-[A0Profile encodeWithCoder:]: unrecognized selector sent to instance *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[A0Profile encodeWithCoder:]: unrecognized selector sent to instance'

@VincentNarbot Did you ever solve this? I'm experiencing the same issue in an app right now.

This is unrelated to the library since if you see the error the failure is when encoding the A0Profile not storing the data with the lib.

In the latest iOS libs the profile does not implement NSSecureCoding so it can't be encoded