dan6erbond
07/05/2022, 11:40 AMPOST /auth/<user-type>
and then call a function from SuperTokens SDK to create that user: https://supertokens.com/docs/nodejs/modules/recipe_thirdpartyemailpassword.html#emailPasswordSignUp-1
Is this a good way to go about it? Also, how much data is recommended to be stored with the UserMetadata recipe? Should it only be for very simple structs or can I use SuperTokens to handle business data such as a paid subscription or personal data? https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/usermetadata/aboutrp_st
07/05/2022, 11:42 AMrp_st
07/05/2022, 11:49 AMdan6erbond
07/05/2022, 11:55 AMThirdPartyEmailPassword.emailPasswordSignUp()
would be the way to go?
> In the DB, it's just a TEXT column. So you can store quite a bit. Keep in mind though that each time you query for the metadata, you get back the whole object.
Got it, so I can store a lot, but probably shouldn't use it for too much complex data if I want to be able to query and such later. Makes sense.
> It can be used for anything, as long as you want to query it based on userId first. So for examlpe, if you are storing a user's subscription in it, the only way you can resolve queries like "give me all users who have subscribed", is to loop through all users and check their metadata. So for complex stuff, we recommend that you store that info in your own DB.
Perfect, thanks! Then it'll probably be combined with a separate DB for more complex stuff, but I think subscriptions can be handled in SuperTokens because I'll only be doing those kinds of queries for analysis, which won't be often. 😉rp_st
07/05/2022, 11:57 AMrp_st
07/05/2022, 11:58 AMcreateNewSession
function in the Session.init to create return an empty session like so: https://github.com/supertokens/supertokens-auth-react/blob/master/examples/with-no-session-on-sign-up-thirdpartyemailpassword/api-server/index.js#L88dan6erbond
07/05/2022, 12:11 PMrp_st
07/05/2022, 12:28 PMSuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).
Powered by