@@ -34,7 +34,7 @@ const morgan = require("morgan");
3434let {
3535 customAuth0Provider,
3636 maxVersion,
37- createCoreApplication ,
37+ setupCoreApplication ,
3838 addLicense,
3939 mockThirdPartyProvider,
4040 getCoreUrl,
@@ -173,24 +173,9 @@ initST();
173173async function setupApp ( {
174174 appId,
175175 coreConfig,
176- accountLinkingConfig = { } ,
177- enabledRecipes,
178- enabledProviders,
179- passwordlessFlowType,
180- passwordlessContactMethod,
181- mfaInfo = { } ,
182176} = { } ) {
183- const coreAppUrl = await createCoreApplication ( { appId, coreConfig } ) ;
177+ const coreAppUrl = await setupCoreApplication ( { appId, coreConfig } ) ;
184178 console . log ( "Connection URI: " + coreAppUrl ) ;
185- initST ( {
186- coreUrl : coreAppUrl ,
187- accountLinkingConfig,
188- enabledRecipes,
189- enabledProviders,
190- passwordlessFlowType,
191- passwordlessContactMethod,
192- mfaInfo,
193- } ) ;
194179
195180 return coreAppUrl ;
196181}
@@ -204,6 +189,7 @@ function initST({
204189 passwordlessContactMethod,
205190 mfaInfo = { } ,
206191} = { } ) {
192+ console . error ( 'initST called' )
207193 if ( process . env . TEST_MODE ) {
208194 UserRolesRaw . reset ( ) ;
209195 PasswordlessRaw . reset ( ) ;
@@ -669,7 +655,7 @@ app.post("/test/after", (_, res) => {
669655 res . send ( ) ;
670656} ) ;
671657
672- app . post ( "/test/setup" , async ( req , res ) => {
658+ app . post ( "/test/setup/app " , async ( req , res ) => {
673659 try {
674660 res . send ( await setupApp ( req . body ) ) ;
675661 } catch ( err ) {
@@ -678,6 +664,15 @@ app.post("/test/setup", async (req, res) => {
678664 }
679665} ) ;
680666
667+ app . post ( "/test/setup/st" , async ( req , res ) => {
668+ try {
669+ res . send ( await initST ( req . body ) ) ;
670+ } catch ( err ) {
671+ console . log ( err ) ;
672+ res . status ( 500 ) . send ( err . toString ( ) ) ;
673+ }
674+ } ) ;
675+
681676// custom API that requires session verification
682677app . get ( "/sessioninfo" , verifySession ( ) , async ( req , res , next ) => {
683678 let session = req . session ;
0 commit comments