Skip to content

Commit

Permalink
Handle error when foreign user is not found in Gateway (GladysAssista…
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Sep 13, 2019
1 parent f9c87b8 commit 856cac4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions front/src/actions/login/loginGateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,16 @@ function createActions(store) {
route('/link-gateway-user');
}
} catch (e) {
store.setState({
gatewayLoginStatus: RequestStatus.Error
});
const error = get(e, 'response.error');
// if user was previously linked to another instance, we reset the user id
if (error === 'LINKED_USER_NOT_FOUND') {
await state.session.gatewayClient.updateUserIdInGladys(null);
route('/link-gateway-user');
} else {
store.setState({
gatewayLoginStatus: RequestStatus.Error
});
}
}
},
updateLoginEmail(state, e) {
Expand Down

0 comments on commit 856cac4

Please sign in to comment.