Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
const simpleOptions: Options = {
accessControl: ACCESS_CONTROL.BIOMETRY_ANY,
accessible: ACCESSIBLE.ALWAYS,
authenticationType: AUTHENTICATION_TYPE.BIOMETRICS,
accessGroup: 'accessGroup',
authenticationPrompt: 'authenticationPrompt',
service: 'service',
};
canImplyAuthentication(simpleOptions).then(result => {
(result: boolean);
});
getSupportedBiometryType().then(result => {
(result: ?string);
});
// $FlowExpectedError - First 3 arguments are required
setInternetCredentials();
setInternetCredentials('server', 'username', 'password');
setInternetCredentials('server', 'username', 'password', simpleOptions).then(
result => {
(result: void);
}
);
// $FlowExpectedError - First argument is required
hasInternetCredentials();
hasInternetCredentials('server').then(result => {
(result: boolean);
componentDidMount() {
addAppStateChangeListener(this.handleAppStateChange);
const { useBiometrics } = this.props;
const { lastAppState } = this.state;
if (!this.errorMessage && DEFAULT_PIN) {
this.handlePinSubmit(DEFAULT_PIN);
}
if (useBiometrics
&& !this.errorMessage
&& lastAppState !== BACKGROUND_APP_STATE) {
Keychain.getSupportedBiometryType()
.then((biometryType) => {
this.setState({ supportedBiometryType: getBiometryType(biometryType) });
this.showBiometricLogin();
})
.catch(() => null);
}
this.handleLocking(true);
}
handlePinSubmit = (pin: string) => {
const { wallet: { onboarding: wallet }, confirmPinForNewWallet, navigation } = this.props;
const previousPin = wallet.pin;
const validationError = validatePin(pin, previousPin);
if (validationError) {
this.setState({
errorMessage: validationError,
});
return;
}
Keychain.getSupportedBiometryType()
.then((biometryType) => {
if (biometryType) {
navigation.navigate(BIOMETRICS_PROMPT, { biometryType });
confirmPinForNewWallet(pin);
} else {
confirmPinForNewWallet(pin, true);
}
})
.catch(() => { confirmPinForNewWallet(pin, true); });
};
componentDidMount() {
Keychain.getSupportedBiometryType().then(biometryType => {
this.setState({ biometryType });
});
}
componentDidMount() {
Keychain.getSupportedBiometryType()
.then(supported => this.setState({ showBiometricsSelector: !!supported }))
.catch(() => null);
}
componentDidMount() {
const { logScreenView } = this.props;
logScreenView('View profile', 'Profile');
Keychain.getSupportedBiometryType()
.then(supported => this.setState({ showBiometricsSelector: !!supported }))
.catch(() => null);
}
const {
fetchInitialAssets,
fetchAllCollectiblesData,
assets,
logScreenView,
} = this.props;
logScreenView('View assets list', 'Assets');
if (!Object.keys(assets).length) {
fetchInitialAssets();
}
fetchAllCollectiblesData();
Keychain.getSupportedBiometryType()
.then(supported => this.setState({ supportsBiometrics: !!supported }))
.catch(() => null);
}
componentDidMount() {
Keychain.getSupportedBiometryType().then(biometricsType => {
if (biometricsType) this.setState({ biometricsType });
});
}