Skip to content

Commit 8e6f0a2

Browse files
committed
fix(auth): Restore non-normalized keychain namespace in AuthSessionHelper.
1 parent 178e106 commit 8e6f0a2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

AmplifyPlugins/Auth/AWSCognitoAuthPluginIntegrationTests/Support/AuthSessionHelper.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ struct AuthSessionHelper {
2525
// Please note that the clientId + username namespace combination is
2626
// normalized by converting it to a lower-case string somewhere upstream
2727
// of the AWSUICKeyChainStore. So, the same is done below.
28-
let namespace = "\(clientId).\(username)".lowercased()
28+
let namespace = "\(clientId).\(username)"
29+
invalidateSession(keychain: keychain, namespace: namespace)
30+
31+
let namespaceNormalized = namespace.lowercased()
32+
invalidateSession(keychain: keychain, namespace: namespaceNormalized)
33+
}
34+
35+
private static func invalidateSession(keychain: AWSUICKeyChainStore, namespace: String) {
2936
let expirationKey = "\(namespace).tokenExpiration"
3037
let refreshTokenKey = "\(namespace).refreshToken"
3138

0 commit comments

Comments
 (0)