MM-18179 Clear cache and cookies for SSO login (#3220)

* MM-18179 Clear cache and cookies for SSO login

* Update app/components/failed_network_action/index.js

Co-Authored-By: Miguel Alatzar <migbot@users.noreply.github.com>
This commit is contained in:
Elias Nahum 2019-09-05 19:23:23 +09:00
parent b37811d8e1
commit 90f6fd6cb8
No known key found for this signature in database
GPG key ID: E038DB71E0B61702
3 changed files with 3 additions and 12 deletions

View file

@ -174,16 +174,7 @@ RCT_EXPORT_METHOD(
WKHTTPCookieStore *cookieStore = [[WKWebsiteDataStore defaultDataStore] httpCookieStore];
[cookieStore getAllCookies:^(NSArray<NSHTTPCookie *> *allCookies) {
for(NSHTTPCookie *currentCookie in allCookies) {
// Uses the NSHTTPCookie directly has no effect, nor deleted the cookie nor thrown an error.
// Create a new cookie with the given values and delete this one do the work.
NSMutableDictionary<NSHTTPCookiePropertyKey, id> *cookieData = [NSMutableDictionary dictionary];
[cookieData setValue:currentCookie.name forKey:NSHTTPCookieName];
[cookieData setValue:currentCookie.value forKey:NSHTTPCookieValue];
[cookieData setValue:currentCookie.domain forKey:NSHTTPCookieDomain];
[cookieData setValue:currentCookie.path forKey:NSHTTPCookiePath];
NSHTTPCookie *newCookie = [NSHTTPCookie cookieWithProperties:cookieData];
[cookieStore deleteCookie:newCookie completionHandler:^{}];
[cookieStore deleteCookie:currentCookie completionHandler:^{}];
}
resolve(nil);
}];

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "mattermost-mobile",
"version": "1.22.1",
"version": "1.23.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -147,4 +147,4 @@
"node_modules/(?!react-native|jail-monkey)"
]
}
}
}