Closed david-loe closed 1 month ago
The changes in this pull request focus on enhancing the MagicLoginStrategy
and related authentication processes. Key modifications include the introduction of a JWT token handling mechanism, updates to email sending functionality, and improvements to user verification logic. A new function for generating authenticated links has been added, and existing functions have been modified to incorporate JWT decoding and dynamic redirect handling. Additionally, new dependencies for JWT support have been introduced in the package.json
.
File | Change Summary |
---|---|
backend/authStrategies/magiclogin.ts | - Introduced genAuthenticatedLink function for JWT token generation.- Updated sendMagicLink with new parameter.- Modified verify function to check user activity. |
backend/controller/authController.ts | - Added JWT decoding in magicloginCallbackHandler .- Updated magicloginHandler for active user checks.- Introduced redirectToFrontend method. |
backend/mail/mail.ts | - Changed sendMail to async and added authenticateLink parameter.- Introduced _sendMail for individual email sending. |
backend/templates/mail.ejs | - Corrected typo in variable name from paragaph to paragraph . |
backend/package.json | - Added jsonwebtoken and @types/jsonwebtoken dependencies. |
Objective | Addressed | Explanation |
---|---|---|
Add magiclogin token to email links (#101) | ✅ |
magiclogin.ts
and authController.ts
improve email handling, which is relevant to user verification enhancements.In the meadow where magic links fly,
A token now dances, oh my, oh my!
With emails that sparkle, and users so bright,
Authentication's magic takes flight tonight!
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Fixes #101
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
jsonwebtoken
for enhanced token handling.Style