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 committed by GitHub
parent f6afab212b
commit 67a28d0af3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 15 deletions

View file

@ -13,7 +13,7 @@ import Cloud from './cloud';
export default class FailedNetworkAction extends PureComponent {
static propTypes = {
action: PropTypes.func,
onRetry: PropTypes.func.isRequired,
actionId: PropTypes.string,
actionDefaultMessage: PropTypes.string,
errorId: PropTypes.string,
@ -29,7 +29,7 @@ export default class FailedNetworkAction extends PureComponent {
};
render() {
const {action, actionId, actionDefaultMessage, errorId, errorDefaultMessage, theme} = this.props;
const {actionId, actionDefaultMessage, errorId, errorDefaultMessage, onRetry, theme} = this.props;
const style = getStyleFromTheme(theme);
const errorTitle = {
@ -59,7 +59,7 @@ export default class FailedNetworkAction extends PureComponent {
id={actionId}
defaultMessage={actionDefaultMessage}
style={style.link}
onPress={action}
onPress={onRetry}
/>
),
}}

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

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