My requirement is to use magic login method (send an email to login to the system via link). Once the user is authenticated, server sends the JWT token to the client. So consequent requests made to the server will be authorized by the JWT.
I've being following official magic link guide however, by default it complains to install express-session to handle the session. However, when the session is set to false, response of the /magiclogin/callback will become 404.
router.get(
'/magiclogin/callback',
authPassport.authenticate('magiclogin', {
session: false,
})
)
How can I,
- Send back a newly generated token using
jsonwebtokenfrom the/magiclogin/callbackendpoint in a way that passport-jwt is compatible?
From the documentation, it's not clear to me how to manually handle the session process.