W
Wasp-langβ€’5w ago
Mrr

how to remove email verification for creating account??

I want user to be able to create account with username and password with no email verification. I commented out the email past in main.wasp and it has removed the login form in the ui (only Google auth is there in ui) . Is there any way to skip this email verification??
15 Replies
kapa.ai
kapa.aiβ€’5w ago
Hi @Mrr. 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 skip the email verification step in development mode by setting the SKIP_EMAIL_VERIFICATION_IN_DEV environment variable to true in your .env.server file. Here is how you can do it:
SKIP_EMAIL_VERIFICATION_IN_DEV=true
SKIP_EMAIL_VERIFICATION_IN_DEV=true
This 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. By default, Wasp requires the email to be verified before allowing the user to log in. This is done by sending a verification email to the user's email address and requiring the user to click on a link in the email to verify their email address. If you want to use the simplest method for local development testing, you can remove all auth methods except usernameAndPassword as suggested in one of the Discord threads. Please note that this is only recommended for development and testing purposes. In a production environment, it's important to verify the user's email address to prevent spam and unauthorized access. For more details, you can refer to the Wasp documentation on Email Verification Flow (https://wasp-lang.dev/docs/auth/email#email-verification-flow). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Mrr, 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?
miho
mihoβ€’5w ago
You mention username and password but then you mention you want to use only Google. Do you want to use username and password or just Google? There is a usernameAndPassword auth method in Wasp: https://wasp-lang.dev/docs/auth/username-and-pass
Username & Password | Wasp
Wasp supports username & password authentication out of the box with login and signup flows. It provides you with the server-side implementation and the UI components for the client side.
Mrr
Mrrβ€’5w ago
I don't want the email verification coming while using username and password.
miho
mihoβ€’5w ago
If you are using usernameAndPassword auth method, there is not email verification since emails are not used πŸ™‚
Mrr
Mrrβ€’5w ago
Sorry when user creates a new account using email and password. I don't want verification I want user to directly login
miho
mihoβ€’5w ago
That's not currently possible with Wasp - email verification ensures that you can trust the provided email and that nobody can steal user's email by signing up as them. If you don't need that security - feel free to use the username & password login with one extra field - email which can be then used for communication with the user e.g. sending them notifications.
Mrr
Mrrβ€’4w ago
Username and password login is working. But I have a small issue ... when I see the db it's shows the new user ID and all but it shows Username null. I tried to figure this but couldn't..
Mrr
Mrrβ€’4w ago
No description
miho
mihoβ€’4w ago
Yep, you are not setting the extra fields: https://wasp-lang.dev/docs/auth/overview#1-defining-extra-fields See what Open SaaS does by default for the email auth to understand what I mean: https://github.com/wasp-lang/open-saas/blob/main/template/app/src/auth/userSignupFields.ts#L6
GitHub
open-saas/template/app/src/auth/userSignupFields.ts at main Β· wasp-...
A free, open-source SaaS app starter for React & Node.js with superpowers. Full-featured. Community-driven. - wasp-lang/open-saas
Overview | Wasp
Auth is an essential piece of any serious application. That's why Wasp provides authentication and authorization support out of the box.
Mrr
Mrrβ€’4w ago
When I use username and password auth I have to set an extra field and store username?Because in the schema there is already username right methods: { usernameAndPassword: {}, },
miho
mihoβ€’4w ago
If you want to have the username directly on the User, you need to use extra user fields like I linked πŸ™‚ otherwise, you access it via user.identities.username.id which is also described in the Wasp docs.
Mrr
Mrrβ€’4w ago
Username & Password | Wasp
Wasp supports username & password authentication out of the box with login and signup flows. It provides you with the server-side implementation and the UI components for the client side.
Mrr
Mrrβ€’4w ago
I followed this Ok will try it. Just for some clarification the email and username field will be null right?
miho
mihoβ€’4w ago
It will be null unless you set it via the userSignupFields πŸ˜„
Mrr
Mrrβ€’4w ago
Ok got it thanks 😊
Want results from more Discord servers?
Add your server