[Solved] Tutorial: Auth redirect simply throws 500

I'm currently following along in the tutorial and got to the authentication step. I then migrated the database with the new User entity and copy/pasting the authentication pages. But now when I simply hit the "root" page / it doesn't redirect me to the login/signup pages. It simply hits the /me endpoint and throws a 500 error: HttpError not defined. The branch with this error can be found here: https://github.com/Kikketer/StorAI/blob/56b2c05be64be57bb370d2d3ec03a76119b40279/main.wasp#L11-L11 The step I was on is here: https://wasp-lang.dev/docs/tutorials/todo-app/06-auth#updating-mainpage-page-to-check-if-the-user-is-authenticated
Authentication | Wasp
Most of the apps today are multi-user, and Wasp has first-class support for it, so let's see how to add it to our Todo app!
GitHub
StorAI/main.wasp at 56b2c05be64be57bb370d2d3ec03a76119b40279 · Kikk...
Wasp Hackathon entry for a dungeon crawl adventure - StorAI/main.wasp at 56b2c05be64be57bb370d2d3ec03a76119b40279 · Kikketer/StorAI
9 Replies
Vinny (@Wasp)
Vinny (@Wasp)2y ago
Hey there. Can you try making the username field optional, eg username String?
Chris
Chris2y ago
Doing that simply throws an error on migrate (I wiped all of the .wasp directory before doing it):
❌ --- [Error] Your wasp project failed to compile: -------------------------------

- Expected an Entity referenced by app.auth.userEntity to have field 'username' of type 'String'.
❌ --- [Error] Your wasp project failed to compile: -------------------------------

- Expected an Entity referenced by app.auth.userEntity to have field 'username' of type 'String'.
Vinny (@Wasp)
Vinny (@Wasp)2y ago
Hm ok. Obviously that is not it. For future reference you can run wasp clean And then wasp start to recompile everything Let me try and run your project and see if I can reproduce the error
Chris
Chris2y ago
Awesome thanks. It’s not absolutely holding me up (hackathon) but figured it would be useful to report (which I assume is somewhat the goal of this hackathon)
Vinny (@Wasp)
Vinny (@Wasp)2y ago
Hey @Chris there seems to a bug with usernameAndPassword auth method. We will work it out ASAP! Thanks so much for bringing it to our attention and sorry for the frustration 🙏 We will let you know as soon as there is an update
Chris
Chris2y ago
Fantastic thanks. Glad I could help
miho
miho2y ago
Can you update your Wasp version to the latest version? (run curl -sSL https://get.wasp-lang.dev/installer.sh | sh) and see if it works now? Thank you for reporting the bug!
Chris
Chris2y ago
Confirmed it works now! Thank you
MEE6
MEE62y ago
Wohooo @Chris, you just became a Waspeteer level 2!
Want results from more Discord servers?
Add your server