W
Wasp4w ago
macevilc

EmailSignupData type mismatch with 0.17 docs

Hey guys I saw in the documentation here that the signup action has the email and password fields. But if you look at the EmailSignupData in my code in the screenshot it has the username and password any idea why?
No description
13 Replies
kapa.ai
kapa.ai4w ago
Hi @macevilc. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It sounds like you’re seeing type definitions for the username/password auth flow while expecting the email/password ones. Wasp has separate signup/login actions (and types) for each auth method, and there’s ongoing work to unify/templatize them. If your project is configured with username & password auth, you’ll see types with username; if it’s configured with email auth, you should see email. [Merge actions] To fix/confirm: - Check main.wasp -> auth.methods to see which method(s) you enabled (email vs usernameAndPassword). [Fields in email dict] - For email auth, the signup action takes email and password, and default validations enforce email format and password strength. [Email custom signup; Default validations] - For username & password, the signup action takes username and password. [Username signup action] If you switched auth methods or see stale generated code, don’t modify .wasp files—restart and, if needed, run wasp clean then wasp start to regenerate. [Discord thread] ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @macevilc, 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?
macevilc
macevilcOP4w ago
@kapa.ai I understand but why does EmailSignupData type contain only username and passsword fields instead of email and password.
kapa.ai
kapa.ai4w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Most likely, your app is configured to use the Username & Password auth method, so the generated signup types reflect username/password instead of email/password. In Wasp, you enable exactly one of these methods, and the corresponding actions/types are generated accordingly. [Auth fields] What to check: - Open main.wasp and see which method is enabled under auth.methods: - If usernameAndPassword is enabled, signup expects username and password. [Username signup] - If email is enabled, signup expects email and password. [Email dict fields] If you intended to use email auth, switch auth.methods to email and restart code generation (e.g., restart Wasp) so the types update. Note there’s ongoing work to unify these actions, which may explain naming/templates you’re seeing, but behavior remains per-method. [Merge actions] ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @macevilc, 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?
macevilc
macevilcOP4w ago
@kapa.ai this is my wasp config app myApp { wasp: { version: "^0.17.1" }, title: "My App", head: [ "<link rel='icon' href='/favicon.ico' />", ], auth: { userEntity: Users, methods: { email: { fromField: { name: "My App", email: "noreply@myapp.com" }, emailVerification: { clientRoute: EmailVerificationRoute }, passwordReset: { clientRoute: PasswordResetRoute } }, google: { configFn: import { getConfig } from "@src/server/auth/google", userSignupFields: import { userSignupFields } from "@src/server/auth/google" } }, onAuthFailedRedirectTo: "/signin" }, emailSender: { provider: Dummy } }
kapa.ai
kapa.ai4w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Given your config, you’re using the email auth method (plus Google). With email auth enabled, Wasp’s signup data should use email and password, and default validations check for a valid email and password strength. [Auth fields; Default validations] If you’re seeing a type named EmailSignupData that contains username and password, that suggests either: - You’re looking at types for the Username & Password method (from a different file/version), or - You have stale/generated types from before switching methods. What to do: - Confirm your code references the email method’s userSignupFields (on the email method, not usernameAndPassword). Your config is correct for email. [Email fields] - Restart Wasp to regenerate types. If mismatch persists, run a clean rebuild (e.g., wasp clean then wasp start) so the correct email-based types are generated. The docs show email auth using email/password and userSignupFields when adding extra fields. [Email setup; Extra fields] If after a clean rebuild you still see username/password in EmailSignupData, I’m sorry, but the knowledge sources don’t contain more detail about this specific type name clash; it may be a local cache or version artifact. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @macevilc, 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?
macevilc
macevilcOP4w ago
@kapa.ai [ Wasp ] Starting npm install [ Wasp !] npm warn deprecated @lucia-auth/adapter-prisma@4.0.1: This package has been deprecated. Please see https://lucia-auth.com/lucia-v3/migrate. [ Wasp !] npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead [ Wasp !] npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead [ Wasp !] npm warn deprecated lucia@3.2.2: This package has been deprecated. Please see https://lucia-auth.com/lucia-v3/migrate. [ Wasp !] npm warn deprecated oslo@1.2.1: Package is no longer supported. Please see https://oslojs.dev for the successor project. [ Wasp !] npm warn deprecated oslo@1.2.0: Package is no longer supported. Please see https://oslojs.dev for the successor project. [ Wasp ] Still installing npm dependencies!
Oslo
Oslo
Oslo is an open-source project that aims to provide simple, high-quality auth packages for server-side JS.
kapa.ai
kapa.ai4w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- These are npm deprecation warnings coming from transitive deps used by Wasp’s auth stack (Lucia v3 + Prisma adapter + Oslo). They don’t indicate your install failed; Wasp often surfaces upstream warnings during npm install/start. [CLI verbosity; CRA warnings context] What you can do: - Let install finish and continue; warnings alone aren’t blockers. [CLI verbosity] - If the install actually fails, share the first error (npm ERR!) above the warnings; Wasp team treats noisy logs as known issue. [CLI verbosity] - Keep your Wasp version up to date; migrations note ongoing auth stack changes (moving within the Lucia ecosystem). [0.13 auth changes] I’m sorry, but the knowledge sources don’t provide specific guidance about replacing these packages in your app or Wasp yet. If a hard error mentions patch-package conflicts (e.g., oauth), regenerate/clean and retry (wasp clean; wasp start). [Discord patch error] ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @macevilc, 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?
macevilc
macevilcOP4w ago
I solved this buy adding a custom userSignupFields: import { getEmailUserFields } from "@src/auth/userSignupFields" that accepts email.
martinsos
martinsos4w ago
@miho will know best how to answer this one!
miho
miho4w ago
Answering the initial question: I think we might have a bug on our hands, let me check. Yep, that type needs to contain email instead of username, sorry about that, I'll create an issue for to fix it 🙂
miho
miho4w ago
GitHub
EmailSignupData has username instead of email · Issue #3149 ...
We have a bug in our custom signup function that the EmailSignupData has username and password fields instead of email and password fields. Link to the bug: https://github.com/wasp-lang/wasp/blob/m...
miho
miho4w ago
Thank you for the report!
macevilc
macevilcOP3w ago
Thanks. 🙏

Did you find this page helpful?