eliasbemlo
09/30/2023, 11:11 AMSupertokensService
with a constructor that calls supertokens.init({ ... config ... })
. This setup works great in both development and production. Among other things, we use Session.getSession
during request processing. But for any request I send during an E2E test, I get an Initialisation not done. Did you forget to call the SuperTokens.init function?
error. Also, the /auth/signin
routes are not available.
I've resorted to logging:
console.log('pre-init')
supertokens.init( ... )
console.log('post-init')
and sure enough, I can see my custom init logs, but still supertokens remains uninitialized. I've set DEBUG=com.supertokens
, but this gives me nothing in the E2E test.rp_st
09/30/2023, 12:45 PMeliasbemlo
09/30/2023, 9:47 PMSession.getSession(...)
. This is what throws the "Not initialized" error. But even if I change it to:
supertokens.init(...)
Session.getSession(...)
I still get the error.rp_st
10/01/2023, 3:19 AMrp_st
10/01/2023, 3:19 AMeliasbemlo
10/01/2023, 9:14 AMSession
, ThirdParty
, EmailPassword
, UserMetadata
and Dashboard
recipes. Like I said, it's working fine when running the development server. I'll see if I can set up a minimal reproduction repo.eliasbemlo
10/01/2023, 10:21 AMeliasbemlo
10/01/2023, 11:52 AMsupertokens.init
twice – once during the seeding script before bootstrapping the backend, and once inside the backend. In the seed script, Session
was not initialized. Ensuring init
is only called once seemed to have resolved the issue.rp_st
10/02/2023, 2:07 PMeliasbemlo
10/02/2023, 2:23 PM