Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.build();
const emailAddressWantedAttribute = new Yoti.WantedAttributeBuilder()
.withName('email_address')
.build();
const dynamicPolicy = new Yoti.DynamicPolicyBuilder()
.withWantedAttribute(givenNamesWantedAttribute)
.withWantedAttribute(emailAddressWantedAttribute)
.withFullName(constraints)
.withSelfie()
.withPhoneNumber()
.withAgeOver(18)
.build();
const dynamicScenario = new Yoti.DynamicScenarioBuilder()
.withCallbackEndpoint('/profile')
.withPolicy(dynamicPolicy)
.withExtension(locationExtension)
.build();
yotiClient.createShareUrl(dynamicScenario)
.then((shareUrlResult) => {
res.render('pages/dynamic-share', {
yotiClientSdkId: config.CLIENT_SDK_ID,
yotiShareUrl: shareUrlResult.getShareUrl(),
});
}).catch((error) => {
console.error(error.message);
});
});
router.get('/dynamic-share', (req, res) => {
const dynamicPolicy = new Yoti.DynamicPolicyBuilder()
.withFullName()
.build();
const dynamicScenario = new Yoti.DynamicScenarioBuilder()
.withCallbackEndpoint('/profile')
.withPolicy(dynamicPolicy)
.build();
yotiClient.createShareUrl(dynamicScenario)
.then((shareUrlResult) => {
const qrUrl = shareUrlResult.getShareUrl();
res.render('pages/dynamic-share', {
yotiApplicationId: config.APPLICATION_ID,
yotiScenarioId: config.SCENARIO_ID,
yotiQrUrl: qrUrl,
});
}).catch((error) => {
console.error(error.message);
});
});