support both MagicLink and OTP

How to enable the verification by both ways together, client can verify either by entering OTP sent in email or clicking the "verify-link" can anyone help me on this, thanks in advance
No description
4 Replies
bekacru
bekacru3w ago
you could do it by calling auth.api.signInEmailOTP on the send email callback on the magic link plugin and fetching the OTP from the verification table where the identifier is `sign-in-otp-${email}
javid
javidOP3w ago
Hi @bekacru , thanks for helping, I also trying to check the IP address of magic link trigger and magicLink verification, both the ip address need same. And also trying to implement one more case where both the magicLink trigger and MagicLink will be happening in the same browser, if magicLink verification happens at different browser, the i expect the verification not to happen. Can you please help me in this?
bekacru
bekacru3w ago
For that you'd need a more sophsticated solution. You may need to store the ip adress initally and compare it later on verify using hooks.
javid
javidOP3w ago
Okay, thanks, how to implement the same browser check between otp/magiclink trigger and verification

Did you find this page helpful?