Currently, I am working with two controllers - authController
and onboardingController
. The authController communicates with the onboardingController using the following line of code:
res.redirect('/onboarding/info?profileId=' + profile.id + '&emailAddress=' + profile.emails[0].value)
The onboardingController then receives these query string parameters and converts them into metadata that can be accessed when rendering the respective page:
model.profile = { id: req.query.profileId, email: req.query.emailAddress };
res.render('onboarding/missingInfo', model);
However, as the model.profile
in the onboardingController lacks context about the actual profile data from the authController, I have been passing and receiving data through query strings. I am wondering if there is a better way to achieve this without including the email address in the URL.
Edit: After some research, I have come across the possibility of utilizing express sessions to achieve my desired outcome.