Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const constraints = new Yoti.ConstraintsBuilder()
.withSourceConstraint(sourceConstraint)
.build();
const givenNamesWantedAttribute = new Yoti.WantedAttributeBuilder()
.withName('given_names')
.withConstraints(constraints)
.withAcceptSelfAsserted()
.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) => {
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,
});