on 2023 Jul 26 11:23 AM
Hi Experts,
We have a requirement.
We need to fetch profile.country value on onBeforeSubmit event in the screenset using accounts.search JS API. To do so, we were planning to pass the accounts.search function in Screenset Javascript code. To authenticate the API, we need to pass the querySignature and for that we are generating it with apiKey and signature using HMAC-SHA-1.
For security reason we wanted to place the querySignature generator code in WebSDK and pull the value to pass it as a parameter in accounts.search API.
Could you please let us know how to format the code in WebSDK for onBeforeSubmit event and pass the querySignature to screenset.
Regards,
Vrishabh.
Based on the use case you describe in the comments, I don't believe using onBeforeSubmit is the right way to go. If you want to redirect the user somewhere after login, then I'd suggest you add an onLogin event handler;
see: accounts.addEventHandlers JS
The users being logged in, you'll have access to the profile info through accounts.getAccountInfo JS rather than having to resort to using the search API.
If part of the use case is to prevent the user login if they're not from a specific country, then I would suggest using server side extensions with the onBeforeAccountsLogin and onBeforeSocialLogin events. More info here: Extensions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.