rip21
08/10/2023, 1:46 PMSuperTokensClient.getByUserId()
SuperTokensClient.getByEmail()
You can then pass some sort of generic into it (e.g. list of receipts (as a string) that your ST instance uses) to figure out what are possible return types from these functions. I don't know. Returning unknown
and giving the user a bunch of type guard util functions sounds good to me as well (much easier than complex generic types that are hard to do if you're not an absolute TS pro)
Maybe it feels a bit weird, but basically, the idea is to get info from passwordless_users
thirdparty_users
and all_auth_recipe_users
and other tables via the list of convenient functions.
Also, some e2e testing utils would be nice to have too, so one can create simple users that don't require third-party. E.g. SuperTokensClient.createEmailPasswordUser(email, password)
and Passwordless.createPasswordlessUser(email)
just so it's easy to write e2e stuff.
Surely in the e2e scenario, I can just open a connection to the Postgres instance that runs locally and do some stuff manually there, but I would prefer ST core to do it right.
If you guys already have something like that or you guys have some hints will be glad to hear that.rp_st
08/10/2023, 1:52 PMrp_st
08/10/2023, 1:53 PMrip21
08/10/2023, 4:30 PM