Created
November 11, 2017 14:28
-
-
Save akultomar17/c73622dac3aae9fcfd4eba54ad8eae4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileprivate func loadPasswordFromKeychainAndAuthenticateUser(_ account: String) { | |
guard !account.isEmpty else { return } | |
let passwordItem = KeychainPasswordItem(service: KeychainConfiguration.serviceName, account: account, accessGroup: KeychainConfiguration.accessGroup) | |
do { | |
let storedPassword = try passwordItem.readPassword() | |
authenticateUser(storedPassword) | |
} catch KeychainPasswordItem.KeychainError.noPassword { | |
print("No saved password") | |
} catch { | |
print("Unhandled error") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment