Closed david-loe closed 2 months ago
The changes implemented enhance the magic link authentication process by modifying user lookup logic to be case-insensitive. This is achieved through the introduction of regular expressions for matching user input against the database, ensuring that variations in case do not result in errors. Additionally, a utility function for escaping special characters in regex patterns has been added to improve security and reliability.
Files | Change Summary |
---|---|
backend/authStrategies/magiclogin.ts |
Updated user lookup logic to use a regular expression for case-insensitive matching of the destination . |
backend/controller/authController.ts |
Modified magicloginHandler to query the user with a case-insensitive regex match for destination . Imported escapeRegExp . |
common/scripts.ts |
Added a new function escapeRegExp to escape special regex characters in strings. |
Objective | Addressed | Explanation |
---|---|---|
Make Magic Login case insensitive (#88) | β |
π°
In fields of green, I hop with glee,
Magic links now match, oh so carefree!
No more errors when typing away,
Case doesn't matter, come what may!
With regex magic, all is bright,
Authentication's a joyful delight! π
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 #88
Summary by CodeRabbit
New Features
Bug Fixes