Replacing NSCoder with Swift's Codable
- [x] All new/changed/fixed functionality is covered by tests (or N/A)
- [x] I have added documentation for all new/changed functionality (or N/A)
📋 Changes
- Replaced occurrences of NSKeyedUnarchiver/NSKeyedArchiver with JSONDecoder/JSONEncoder
- Added encode function to Credentials type
📎 References
It doesn't seem like usage of this API is required in this context. Credentials type doesn't use polymorphism, which could be only handled by NSKeyedUnarchiver.
Thanks to these changes my code now properly runs inside a SPM package
Please let me know if there is something that I don't understand :)
https://forums.swift.org/t/should-i-stick-with-codable-or-switch-back-to-nscoding/61604 https://github.com/auth0/Auth0.swift/issues/862
🎯 Testing
This is not a breaking change, these code paths are covered by unit tests
@theolampert sorry for tagging you here, I was just wondering if there is any button to ask for the review from maintainers and I clicked it without thinking much about it :E
Hi @Vaidios,
Thank you for raising a PR to address this, we will look into it and get back to you !
Hey @desusai7, are there any updates on this?
Hello @desusai7
We are encountering the same issue which gets "No credentials were found in the store." message. Could you please provide any updates on when this issue might be resolved? Thank you.
Hi everyone,
We cannot accept this PR because JSONDecoder cannot read credentials encoded with NSKeyedArchiver. This means all the users of all Auth0 customers using this SDK would be logged out after updating the app and would have to log in again.
This is precisely the reason why the existing NSKeyedUnarchiver/NSKeyedArchiver-based solution was left as-is during the development of Auth0.swift v2.
@shusuke0812 please see https://github.com/auth0/Auth0.swift/issues/862#issuecomment-2583238245 for a way to log the underlying Keychain error.