Hello, we got this weird flow that we wanna signup users and create password for those users from ou...
e
Hello, we got this weird flow that we wanna signup users and create password for those users from our own dashboard. Problem with using the signUp method
import { signUp } from 'supertokens-web-js/recipe/emailpassword'
is that its sending along the cookies, that logsout initial users and switch to the register one 😉 anyway to avoid the authentication & sending cookies along?
r
Hey!
e
Hello :)!
r
Yea. You can make your own api on the backend which calls the signUp function of the backend SDK. That will not create cookies. It will just create the user in supertokens
e
Will do that. Thought there might be a quick hacky way by adding some userContext from the client hehe 😉
Thanks!
r
Uhmm. Well, there is that too. You can call the signUp function on the frontend, and then on the backend override the signUp api to call getSession with session as being optional. If a session exists, you can add that to the user context. Then in the createNewSession override, you can check if a session exists in the user context and if it does, just return that instead of creating a new session
But personally I find the separate api easier to do
e
right, yeah the api option is faster 😉
Thanks for the clear answer again 😄
r
Yup!
e
took 1 min 🙂 hehe