Hi, here’s my flow and the problem I’m having:
-
User comes to site, tries to login, sees a TypeForm form (typeform.com)
-
Upon completion of the TypeForm, TypeForm calls a webhook by doing a POST to a function I have in http-functions.js on Wix
-
Inside that function, I parse the JSON payload from TypeForm and create a temporary password for the user
-
I email the user with his/her temp password
So far so good; all of this works.
(Please don’t ask me to change my login setup; I NEED this kind of flow.)
However, I also want to log in the user right away, to remove friction.
So I created another backend login function, which seems to work. I pass it the email and password, and that function returns a promise string. I copied that code from here: https://www.wix.com/corvid/reference/wix-users-backend/login
Then, in my front-end http-functions.js, I have code that calls that backend function and tries to apply the sessionToken. I copied that code from here:
https://www.wix.com/corvid/reference/wix-users/applysessiontoken
I’m handling the error, and this is what I’m getting, after calling wixUsers.applySessionToken(result.sessionToken):
TypeError: _wixUsersBackend2.default.applySessionToken is not a function
Any thoughts/help would be greatly appreciated. Thanks.