forked from vergnet/application-amicale
Logout user if token expires
This commit is contained in:
parent
2ee3ed001c
commit
0ee0a6db3a
1 changed files with 6 additions and 1 deletions
|
@ -70,7 +70,12 @@ class AuthenticatedScreen extends React.Component<Props, State> {
|
||||||
: null;
|
: null;
|
||||||
this.errorCode = error;
|
this.errorCode = error;
|
||||||
|
|
||||||
if (this.allRequestsFinished())
|
if (this.errorCode === ERROR_TYPE.BAD_TOKEN) { // Token expired, logout user
|
||||||
|
this.connectionManager.disconnect()
|
||||||
|
.then(() => {
|
||||||
|
this.props.navigation.navigate("LoginScreen");
|
||||||
|
});
|
||||||
|
} else if (this.allRequestsFinished())
|
||||||
this.setState({loading: false});
|
this.setState({loading: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue