W
Wasp-langβ€’4mo ago
NemusAI

Disable Email Verification in Production

Hi folks, love the framework! Was wondering if there's a way to disable email verification? To clarify, email/password login is good, just don't want/need users to go through email verification (for now). Equally, any idea how to get rid of this alert on sign up? Thanks!
No description
12 Replies
kapa.ai
kapa.aiβ€’4mo ago
Hi @NemusAI. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, you can disable the email verification in Wasp during development. You can do this by setting the SKIP_EMAIL_VERIFICATION_IN_DEV environment variable to true in your .env.server file. Here's how you can do it:
.env.server
SKIP_EMAIL_VERIFICATION_IN_DEV=true
.env.server
SKIP_EMAIL_VERIFICATION_IN_DEV=true
This setting is useful when you are developing your app and don't want to go through the email verification flow every time you sign up. It can also be useful when you are writing automated tests for your app source (https://wasp-lang.dev/docs/auth/email#email-verification-flow). As for the alert on sign up, without more specific information about the alert you're referring to, it's hard to provide a precise solution. However, if the alert is related to the sign-up process, you might want to check your custom sign-up action if you have one. You can customize the sign-up process, including the messages returned upon sign-up, as shown in the Wasp documentation (https://wasp-lang.dev/docs/auth/email#creating-a-custom-sign-up-action). If you need more help, consider asking the Wasp community on their Discord server (https://discord.com/channels/686873244791210014/1223180353460506695). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @NemusAI, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
NemusAI
NemusAIβ€’4mo ago
For additional context, Im using the opensaas template
Soham
Sohamβ€’4mo ago
You can add a line after successful submission from backend to db to make a db query to make email verified flag to true.
martinsos
martinsosβ€’4mo ago
I am not sure how tricky is that to do right now though without having the auth hooks (which are coming any moment). What about going with username & pass isntead @NemusAI ? That sounds like it will be closer to what you need then,and you can add additional field to collect their email if you want. Later you can switch to email&pass if you want (it will require data migration though). Is this long term, you never want to have email verification, or you are in some testing phase and don't want to have it for just now?
Soham
Sohamβ€’4mo ago
I mean if there's a bool column in db like isemailverified for email verification, we can change it's value on submit of sign up form. @martinsos
martinsos
martinsosβ€’4mo ago
Right but at which moment would you do that? It is not so simple at the moment to trigger something after signup. Which is why we are adding auth hooks that I menittioned above, and they are coming soon, but are not released yet. There are maybe some hacky ways to try to do it, but nothing nice. Except for of course not using AUth UI from Wasp, but instead impelmenting your own sign up action, which you can do, but then you have o also have your own UI, and that is quite more work.
Soham
Sohamβ€’4mo ago
Alright, I got your point
NemusAI
NemusAIβ€’4mo ago
We need to use capture email unfortunately (hard requirement), but eventually we will likely have email verification. For now though we need to skip it to allow seamless login (somewhat related to this message where you mention you cannot have log in upon sign up without verifying email): https://discord.com/channels/686873244791210014/1244519109467570246/1244700682951590040 Upon further reflection, it looks like these are two parts to the one problem: How to log a user in after email sign up (which requires disabling email verification) What about going with username sign up, but adding the additional email field, hiding the username field, and auto-creating a username based on everything before @domain.com ? (and then that will also auto sign in the user since we're username/pw)? I guess the question here is - can I hide the username field (and auto-fill it somehow) on username sign up? Or, even more hackily πŸ˜… , what if we just changed the label of username to email somehow? So it would be username/pw auth, but the field label would change from username to email - that way we capture email, no verification required, automatic sign in
MEE6
MEE6β€’4mo ago
Wohooo @NemusAI, you just became a Waspeteer level 1!
NemusAI
NemusAIβ€’4mo ago
Actually, this wont work - I'm using opensaas which requires an email auth method for Stripe. It needs to be Email + skip verification 😦
martinsos
martinsosβ€’4mo ago
@NemusAI thakns for all the feedback here, I made an issue on GH and we will be looking into this, likely enabling going without verification if user really wants!
NemusAI
NemusAIβ€’4mo ago
πŸ™
Want results from more Discord servers?
Add your server