2
0

Fixed issue when signing out on iOS + issue with biometrics not getting enabled properly after enabling TouchID.

This commit is contained in:
Maarten Billemont 2016-07-05 20:15:18 -04:00
parent 2897bc741c
commit 28bd162e05

View File

@ -78,6 +78,7 @@ static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigi
if (user.saveKey) { if (user.saveKey) {
inf( @"Saving key in keychain for user: %@", user.userID ); inf( @"Saving key in keychain for user: %@", user.userID );
[self forgetSavedKeyFor:user];
[PearlKeyChain addOrUpdateItemForQuery:createKeyQuery( user, YES, nil ) [PearlKeyChain addOrUpdateItemForQuery:createKeyQuery( user, YES, nil )
withAttributes:@{ withAttributes:@{
(__bridge id)kSecValueData : [self.key keyDataForAlgorithm:user.algorithm], (__bridge id)kSecValueData : [self.key keyDataForAlgorithm:user.algorithm],
@ -100,6 +101,7 @@ static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigi
if (self.key) if (self.key)
self.key = nil; self.key = nil;
self.activeUser = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:MPSignedOutNotification object:self userInfo:@{ @"animated" : @(animated) }]; [[NSNotificationCenter defaultCenter] postNotificationName:MPSignedOutNotification object:self userInfo:@{ @"animated" : @(animated) }];
} }
@ -171,15 +173,7 @@ static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigi
self.key = tryKey; self.key = tryKey;
// Update the key chain if necessary. // Update the key chain if necessary.
switch (self.key.origin) { [self storeSavedKeyFor:user];
case MPKeyOriginMasterPassword:
[self storeSavedKeyFor:user];
break;
case MPKeyOriginKeyChain:
case MPKeyOriginKeyChainBiometric:
break;
}
} }
@try { @try {