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 92f20a78ef
commit eaa81d5fcd

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];
}
}