fix ios sso cookie bug when running on top-level domain (#2858)

This commit is contained in:
Gleb 2019-06-15 21:22:49 +03:00 committed by Elias Nahum
parent a75c4d0a02
commit dddfcbc362
No known key found for this signature in database
GPG key ID: E038DB71E0B61702

View file

@ -134,7 +134,8 @@ RCT_EXPORT_METHOD(
[cookieStore getAllCookies:^(NSArray<NSHTTPCookie *> *allCookies) {
NSMutableDictionary *cookies = [NSMutableDictionary dictionary];
for(NSHTTPCookie *currentCookie in allCookies) {
if([currentCookie.domain containsString:topLevelDomain]) {
NSString *domainWithDot = [NSString stringWithFormat:@".%@", currentCookie.domain];
if([currentCookie.domain containsString:topLevelDomain] || [domainWithDot containsString:topLevelDomain]) {
[cookies setObject:currentCookie.value forKey:currentCookie.name];
}
}