Happy to help with reviewing afterwards if familiarity is needed with managing ESM/CJS exports. But I'd still need someone else who could confirm that the desired outcome is being achieved.
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).