Afzal
Afzal
CCConvex Community
Created by Afzal on 9/15/2024 in #support-community
How to redirect to register page from restricted rout if new user
What would be the best way to implement this: I am using Convex AUTH and Nextjs with email otp based authentication using Node mailer. When user submits OTP we verify the OTP and check is the user is existing user or new user using isNewUser query. Based on that I am able to redirect to register page or home page. But there is an edge case I am unable to figure out: if user didn't complete the registration flow and refreshed the page, the user is getting redirected to home page as while submiting the OTP i had already verified the user which gets autheticated. What would be best way to handle this where we restrict the home if user is new user. I tried creating a query function and use it in middleware but it seems that query functions cannot be used in middleware.
16 replies
CCConvex Community
Created by Afzal on 9/6/2024 in #support-community
Convex Auth with NodeMailer OTP
Hi Team!, Instead of using Resent to send OTP, I want to use NodeMailer, is their any way to implement it?
8 replies