SaaS Auth & Login
hi, I run the SaaS app locally. Everything looks fine. I try to sign up as a user, but then can't login. It complains: "Invalid Credentials". I try look in docs but don't see something for this. I am expecting on local, it allows a local stored Auth credentials and then I can test it. Perhaps I am missing something? Thanks!
5 Replies
Wohooo @PM10, you just became a Waspeteer level 1!
Hi @PM10. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
It seems like you're having trouble with the authentication process in your Wasp SaaS application. The error message "Invalid Credentials" typically appears when the username and password provided do not match the ones stored in the database.
Here are a few things you could check:
1. Signup Process: Ensure that the signup process was successful and that the user was created in the database. You can customize the signup process and add extra fields if needed. Check the documentation (https://wasp-lang.dev/docs/auth/overview#1-defining-extra-fields) for more details.
2. Login Process: Make sure you're using the correct username and password that were used during the signup process. The login and signup flows in Wasp are pretty standard: they allow the user to sign up and then log in with their username and password. The signup flow validates the username and password and then creates a new user entity in the database. You can read more about this in the documentation (https://wasp-lang.dev/docs/auth/username-and-pass#customizing-the-auth-flow).
3. Error Messages: Wasp is working on improving the error messaging on Login & Signup. Instead of showing the
401
message, they plan to show a nicer "Your login credentials are invalid" or similar message. You can follow this Github issue (https://github.com/wasp-lang/wasp/issues/1114) for updates.
4. Automatic Login After Signup: Currently, after calling signup()
, you are not automatically logged in. You still have to call login()
. This is something that might not be clear in the documentation and is being worked on. You can follow this Github issue (https://github.com/wasp-lang/wasp/issues/151) for updates.
If you're still having trouble, you might want to check the console for any errors or try to create a custom sign-up action as described in the documentation (https://wasp-lang.dev/docs/auth/email#creating-a-custom-sign-up-action).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @PM10, 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?Hi there.
when you sign up, you must check the server logs in the terminal window where you ran
wasp start
. There, you will see a link you can copy and paste to verify the sign up process.
In development, we are emulating the sign-up process, which would normally send you an e-mail to the email address you used, but instead we log it to the console. You can read more about it here: https://docs.opensaas.sh/guides/authentication/#email-verified-authOpenSaaS.sh
Authentication
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.
thanks @Vinny (@Wasp). That works!
Awesome @PM10 ! We will soon be releasing new docs which will make this much clearer :). Thanks for the feedback!