Can a user sign up confirmation be done with a 6 digit code (instead of only magic link)?
I ask this because some users may be signing up on their phone but their email is on their computer or vice versa.
P.S. Thanks again for creating this! Best repo of the last 2 years IMO!
3 Replies
Hi @blueturtle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Thank you for your kind words about Wasp! I'm glad you find it valuable.
Regarding your question about using a 6-digit code for user sign-up confirmation instead of a magic link, Wasp doesn't currently have built-in support for this specific feature. However, it is possible to implement such a system with some custom code.
Based on the information from our knowledge sources, here's what we can say:
1. Wasp's default email authentication system uses magic links for email verification, as mentioned in the Email Authentication docs.
2. However, Wasp allows for customization of the sign-up process. You can create a custom sign-up action that implements your desired verification method, as described in the Username & Password Authentication docs.
3. To implement a 6-digit code verification system, you would need to:
- Generate a 6-digit code during sign-up
- Store this code securely (possibly in the User entity or a separate verification entity)
- Send the code to the user's email
- Create a custom verification page where the user can enter the code
- Verify the entered code against the stored code
4. This approach is similar to the phone verification method suggested in a Discord support thread, where a community member outlined steps for implementing phone verification.
To implement this, you would need to create a custom sign-up action and modify the email sending process to include the 6-digit code instead of a magic link. You would also need to create a custom verification page to handle the code input and verification.
Keep in mind that while this is possible, it would require more custom code and careful consideration of security implications. If you decide to implement this, make sure to handle the storage and verification of the codes securely.
If you need more detailed guidance on implementing this feature, you might want to reach out to the Wasp community for specific code examples or best practices.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @blueturtle, 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?
Hey, we don't currently support that kind of flow, you'd have to build the whole email from scratch to achieve it.
It is something we could expand to. I guess we could go for the code in the URL it gets auto filled but if you visit the URL without the code in the URL, it shows the input box.
Nice idea! I've created an issue for that: https://github.com/wasp-lang/wasp/issues/2470
GitHub
Email verification flow with a code instead of a URL · Issue #2470 ...
Our current email verification process requires users to click a link sent to their email, which then opens the client app to activate their account. This can be inconvenient, for example, when acc...
Hey miho, thanks a lot for entertaining the idea, I appreciate it!