Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const init = async () => {
sdk_token = await simulateCallForApiKey();
onfidoOut = OnfidoSDK.init({
containerId: 'onfido',
// language : 'en', // Currently only 'en' and 'es' are available - custom language objects can be passed
// smsNumberCountryCode: 'GB',
// steps // https://github.com/onfido/onfido-sdk-ui#welcome
token : sdk_token,
useModal : false,
// userDetails: { smsNumber: '+447500123456' }, // Some user details can be predefined for user convenience
onComplete : handleComplete,
});
};
const initOnfido = async (sdk_token) => {
if (!$('#onfido').is(':parent')) {
$('#onfido').setVisibility(1);
try {
onfido = Onfido.init({
containerId: 'onfido',
language : {
locale: getLanguage().toLowerCase() || 'en',
},
token : sdk_token,
useModal : false,
onComplete: handleComplete,
steps : [
'document',
'face',
],
});
$('#authentication_loading').setVisibility(0);
} catch (err) {
$('#error_occured').setVisibility(1);
$('#authentication_loading').setVisibility(0);