Skip to main content
Version: 1.2.2

fix-magic-email-case

🐛 Bug Fixes​

Magic login accepts a different email case​

Goal: A Magic user who types the same address with a different case (for example -EXT instead of -ext) must still be recognized. Azure already matched that way; Magic rejected the token.

Solution: Compare the Magic token email and the requested email case-insensitively. Resolve the account with the existing collation on findUserByEmail, then continue with the email stored on the user. The SMS auth-config lookup uses the same collation, so the pre-login check finds the account too.

Features:

  • prenom-EXT@… matches a stored prenom-ext@… on Magic login
  • The session email is the address stored on the user
  • SMS requirement lookup no longer misses the account because of case

Files Modified:

  • src/domains/gateway/services/magic-link.service.ts - Case-insensitive token check and stored email
  • src/core/auth/auth.service.ts - Case-insensitive auth-config lookup
  • package.json - Pin follow-redirects to 1.16.1
  • package-lock.json - Lockfile for that pin