Domain validation check before sending verification code instead of after signup
Hello Memberstack Team,
I'm using Passwordless Login/Signup, and I have a rule only specific domains are allowed to sign up.
However the user will receive a verification code and try to complete the passwordless signup before they get a error "Your email domain is not permitted for this plan".
I would like the check to happen before they are sent the code. - Jack
Comments
5 comments
What you’ll want to do here is move the domain check to the very first step of the flow, before Memberstack sends out the passwordless verification code. Script #195 – Custom Input Validation is a good fit because it lets you run real-time validation on the email field. With #195, you can check the domain as soon as the user types their email, and if it doesn’t match your allowed list, you can show a custom error message right away and prevent the form from submitting. That way, users never even reach the “send code” step unless their domain is valid.
That said, if your main need is to hard-block code sending at the backend level, you’d need to pair #195 with Memberstack’s API or plan rules. Script #195 is best when you want front-end validation + friendly error messages, while backend rules are necessary if you want to enforce domain restrictions server-side.
Hey Jack, I'm not sure if conditional checks can be achieved just by native memberstack feature for password less login functionality. Although I do suppose we can work around with some custom javascript that can be added to check the domain validation and then move ahead with the memberstack's password less login/signup.
Or if this sounds little complicated to go through, we can also have a workaround with the Gated Content feature of Memberstack which allows the user to show only specified part. Hence you can add your conditions for domain verification there and hide the content behind it and see if that works?
Hi Jayess! Seems like there hasn't been any response to my my reply. I'm going to consider this question resolved. If you need further 1on1 support, you can post a new question at hiophelia.com
Hi Niket and Jayess, so sorry for my radio silence. I have been away on holiday. That would be amazing, if we could do a work around with some Javascript, I believe it would improve the experience.
Thanks Jack.
Hey Jack 👋 What's an example email you would like to allow to join? If you give me the "rules" I can help with the code.
Please sign in to leave a comment.