cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to access response of gigya.accounts.otp.sendCode

0 Kudos
452

Unable to access response of gigya.accounts.otp.sendCode as it's internally triggered by gigya js plugin

We have integrated gigya js plugin in our application for implementing email verification flow. But after submitting user data 2 api's called.

accounts.register api (can access it's response)

accounts.otp.sendCode (can't access response)

May I know how response of send code can be accessed in front end ?

Accepted Solutions (0)

Answers (1)

Answers (1)

shemma
Advisor
Advisor
0 Kudos

Hi Suman,

There are 2 ways you can access the response depends of the way you implement the flow.

1. if gigya screen manage the requests then the way to get the response is to set onAfterSubmit event listener when calling showScreenSet.

gigya.accounts.showScreenSet({

screenSet: "Default-RegistrationLogin",

onAfterSubmit: (event) => {"in the event data you can see the response"}

});

2. if you manage the flow and call manually our api then you can do the following

gigya.accounts.otp.sendCode(callback: (data) => {"in the event data you can see the response"})

Please let us know if this was helpfull.

0 Kudos

Hi Shem,
Thanks for looking into it.
But on Click of gigya-register-screen submit, am able to capture the response of accounts.register call alone in afterSubmit event.
but unable to capture the response of gigya.accounts.otp.sendCode.
screen id used: gigya-register-screen
form id used:
gigya-register-form

shemma
Advisor
Advisor
0 Kudos

Hi Suman,
Submit in registration flow will only expose the register api.
Can you please provide your scenario and share the business requirements to listen to gigya.accounts.otp.sendCode api response?

0 Kudos

On OTP view page which appears right after registration step.

I want to enter OTP and trigger accounts.otp.update call for which I need to pass vToken of accounts.otp.sendCode call as payload.

So want to know how I can access vToken of accounts.otp.sendCode response.

noticed Gigya plugin is not adding vToken by itself during accounts.otp.update call then how can we pass vToken to accounts.otp.update call ?

shemma
Advisor
Advisor
0 Kudos

Hi SUman,

Currently this is not possible.

We handle the entire flow and you dont have an option to extract the vToken and send it in otp.update.