ephemeraHQ / xmtp-inbox-ios

ARCHIVED: See the README for info about an alternative iOS app you can try.
4 stars 0 forks source link

Save keys to Keychain and add sign out #26

Closed elisealix22 closed 1 year ago

elisealix22 commented 1 year ago

This PR adds functionality to save keys based on https://developer.apple.com/documentation/cryptokit/storing_cryptokit_keys_in_the_keychain. I set it to kSecAttrAccessibleWhenUnlocked so it can only be read when the device is unlocked. I believe we are also set up for the future if we want to do multi sign in because we store keys per-address.

To sign out, long press the avatar in the toolbar and it will wipe the keys and signed in address.

Relates to #3

Sign out / sign in demo https://user-images.githubusercontent.com/556051/213181795-8fa895fb-1aaa-4fb9-9d2e-d1cb12b4416b.mp4