passport-magic-login
passport-magic-login copied to clipboard
What's the best strategy to have sendMagicLink fail?
I'd like to use sendMagicLink only to pre-registered users.
At the moment, I'm throwing an error if the submitted email isn't in the database.
This prints something on my server console because of this line: https://github.com/mxstbr/passport-magic-login/blob/dca2bcc2638d74290e218de3a4fd8d92c1aa48e2/src/index.ts#L78
Is that expected? I understand that sendMagicLink might fail for unexpected reasons, but I would have hoped that somehow there was a more elegant way so that no "intended" error is printed in the console.
Maybe sendMagicLink could return void when successful and a custom object when failing?