We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The href being generated by the sendMagicLink function seems be adding 'undefined' before the question mark and token=. Here is my strategy:
const magicLogin = new MagicLoginStrategy({ secret: process.env.MAGIC_LINK_SECRET, callbackURL: '/auth/magiclogin/callback', sendMagicLink: async (destination, href) => { try { console.log(href) await sendEmail(destination.email, destination.givenName, href); } catch (error) { console.error(error); } }, verify: async (payload, callback) => { try { const dbUser = await prisma.user.upsert({ where: { email: payload.destination, }, update: { updatedAt: new Date(Date.now()), }, create: { data: { email: payload.destination, emailVerified: new Date(Date.now()), }, }, include: { employee: { select: { userId: true, isAdmin: true, }, }, }, }); return callback(null, dbUser); } catch (error) { return callback(error); } }, }); passport.use(magicLogin); router.post('/sendlink', magicLogin.send); router.get('/magiclogin/callback', passport.authenticate('magiclogin'));
The href that is passed to my sendMail function looks like this:
undefined?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXN0aW5hdGlvbiI6eyJlbWFpbCI6ImVyaWMuYnJhbnNvbkBnbWFpbC5jb20iLCJnaXZlbk5hbWUiOiJFcmljIn0sImNvZGUiOiI5OTE4MSIsImlhdCI6MTY3NjA0MzMwOCwiZXhwIjoxNjc2MDQ2OTA4fQ.9vAUmm1pAPIX-tJq8qE3HK-mRY-ZMH7qeJByIqO2RWo
I can remove the undefined but I don't know how it got there in the first place.
This is all in windows 10 in Node 18.12.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The href being generated by the sendMagicLink function seems be adding 'undefined' before the question mark and token=.
Here is my strategy:
The href that is passed to my sendMail function looks like this:
undefined?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXN0aW5hdGlvbiI6eyJlbWFpbCI6ImVyaWMuYnJhbnNvbkBnbWFpbC5jb20iLCJnaXZlbk5hbWUiOiJFcmljIn0sImNvZGUiOiI5OTE4MSIsImlhdCI6MTY3NjA0MzMwOCwiZXhwIjoxNjc2MDQ2OTA4fQ.9vAUmm1pAPIX-tJq8qE3HK-mRY-ZMH7qeJByIqO2RWo
I can remove the undefined but I don't know how it got there in the first place.
This is all in windows 10 in Node 18.12.1
The text was updated successfully, but these errors were encountered: