Log login success rate
Summary: Report login success rate Reviewed By: mweststrate Differential Revision: D22698005 fbshipit-source-id: 5f02a2ddaaf54acc564d09a5f781ed649ae8a3e6
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6561bc8f16
commit
ce180a106f
@@ -25,6 +25,7 @@ import {connect} from 'react-redux';
|
||||
import {State as Store} from '../reducers';
|
||||
import ContextMenu from '../ui/components/ContextMenu';
|
||||
import {clipboard} from 'electron';
|
||||
import {reportPlatformFailures} from '../utils/metrics';
|
||||
|
||||
const Container = styled(FlexColumn)({
|
||||
padding: 20,
|
||||
@@ -69,9 +70,7 @@ class SignInSheet extends Component<Props, State> {
|
||||
error: null,
|
||||
};
|
||||
|
||||
saveToken = async (token: string) => {
|
||||
this.setState({token, loading: true});
|
||||
try {
|
||||
login = async (token: string) => {
|
||||
await writeKeychain(token);
|
||||
const user = await getUser();
|
||||
if (user) {
|
||||
@@ -79,6 +78,12 @@ class SignInSheet extends Component<Props, State> {
|
||||
} else {
|
||||
throw new Error('Failed to login using the provided token');
|
||||
}
|
||||
};
|
||||
|
||||
saveToken = async (token: string) => {
|
||||
this.setState({token, loading: true});
|
||||
try {
|
||||
await reportPlatformFailures(this.login(token), 'auth:login');
|
||||
this.setState({loading: false});
|
||||
this.props.onHide();
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user