user
04/16/2021, 6:32 PMuser
04/16/2021, 6:32 PMZeferiniX
04/16/2021, 7:48 PMZeferiniX
04/16/2021, 7:49 PMsession
property under the req
object? is that from express-session
?rp
04/16/2021, 9:01 PMrp
04/16/2021, 9:03 PMjs
import {SessionContainer} from "supertokens-node/recipe/session";
console.log("userId", (req.session as SessionContainer).getUserId()
ZeferiniX
04/16/2021, 9:04 PMZeferiniX
04/16/2021, 10:22 PMsupertokens-website
lib for session management, correct?
now I'm trying to figure out how to add 3rd party custom provider (microsoft/office365 particularly)ZeferiniX
04/16/2021, 10:22 PMZeferiniX
04/16/2021, 10:23 PMsignInAndUpFeature
ZeferiniX
04/16/2021, 10:25 PMthirdpartyemailpassword
https://supertokens.io/docs/thirdpartyemailpassword/common-customizations/signup-form/custom-providersZeferiniX
04/16/2021, 10:25 PMsignInAndUpFeature
ZeferiniX
04/16/2021, 10:26 PMZeferiniX
04/16/2021, 10:28 PMZeferiniX
04/16/2021, 10:36 PMEmailPassword
2. ThirdParty
3. ThirdPartyEmailPassword
the #3 shares the same init signature as #1, if #2 suggests it's both sign in + sign up in one go via ThirdParty.signInUp()
, how does #3 behave with ThirdPartyEmailPassword.signInUp()
?
does it fire on both signInFeature
and signOutFeature
?ZeferiniX
04/16/2021, 11:37 PMZeferiniX
04/16/2021, 11:37 PMthirdpartyemailpassword
ZeferiniX
04/16/2021, 11:38 PMthirdparty
rp
04/17/2021, 3:12 AMproviders
array.
> the #3 shares the same init signature as #1, if #2 suggests it's both sign in + sign up in one go via ThirdParty.signInUp(), how does #3 behave with ThirdPartyEmailPassword.signInUp()?
Think of these recipes as independent.. if you are using ThirdPartyEmailPassword
, don't worry about the other two recipes at all..rp
04/17/2021, 4:52 AMuser
04/17/2021, 5:04 AMrp
04/17/2021, 5:06 AMZeferiniX
04/17/2021, 6:36 AM.middleware()
do aside from initializing the auth routes? If I want to implement my own routes, I can skip this and use the recipe APIs directly right? What will I miss by doing so?
My scenario is that I don't want all of the extra fields, validations and post sign in and up handlers all cluttered within the supertokens.init()
.rp
04/17/2021, 6:42 AM.middleware()
, but you can specifically disable the sign in / up API routes by setting disableDefaultImplementation
to true
in the signUpFeature
and signInFeature
objects when calling the init
function: See https://supertokens.io/docs/nodejs/thirdpartyemailpassword/init
Then, you can create your own API route:
- {authBasePath}/signinup POST (for sign in / up via social login): https://github.com/supertokens/frontend-driver-interface/blob/master/v1.7.0.md#url-apibasepathsigninup
- {apiBasePath}/signin POST (for sign in via email password): https://github.com/supertokens/frontend-driver-interface/blob/master/v1.7.0.md#signin-api
- {apiBasePath}/signup POST (for sign up via emailpassord): https://github.com/supertokens/frontend-driver-interface/blob/master/v1.7.0.md#url-apibasepathsignup
When you create your own routes, make sure the path and method match the above API spec so that the frontend continues to work. Our implementation of these APIs can be found:
- {authBasePath}/signinup POST: https://github.com/supertokens/supertokens-node/blob/master/lib/ts/recipe/thirdparty/api/signinup.ts
- {apiBasePath}/signin POST: https://github.com/supertokens/supertokens-node/blob/master/lib/ts/recipe/emailpassword/api/signin.ts
- {apiBasePath}/signup POST: https://github.com/supertokens/supertokens-node/blob/master/lib/ts/recipe/emailpassword/api/signup.tsrp
04/17/2021, 6:43 AMZeferiniX
04/17/2021, 6:50 AMrp
04/17/2021, 6:50 AMrp
04/17/2021, 6:50 AMZeferiniX
04/17/2021, 6:51 AMrp
04/17/2021, 6:51 AM