fix: reset github token when authentication failed (#388)

This commit is contained in:
Vlad Hashimoto
2020-05-20 21:31:00 +03:00
committed by GitHub
parent 592c220f18
commit c58ade2132
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -69,6 +69,7 @@ export class TokenDialog extends React.Component<TokenDialogProps, TokenDialogSt
} catch (error) {
console.warn(`Authenticating against GitHub failed`, error);
this.setState({ verifying: false, error: true });
this.props.appState.gitHubToken = null;
return;
}
@@ -181,6 +181,7 @@ describe('TokenDialog component', () => {
await instance.onSubmitToken();
expect(wrapper.state('error')).toBe(true);
expect(store.gitHubToken).toEqual(null);
});
});
});