RPD
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai When I do the import like this:
import { getSessionData } from 'wasp/client/operations'
I get this error:
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/rithvikprakki/helios_nexus_website/.wasp/out/sdk/wasp/dist/client/operations/actions' is not supported resolving ES modules imported from /Users/rithvikprakki/helios_nexus_website/.wasp/out/sdk/wasp/dist/client/operations/index.js
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai No I have the function in queries.js and I have it in my main.wasp like this:
query getSessionData {
fn: import { getSessionData } from "@src/queries.js",
}
How do I now import this into hooks.js
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai I have a function in queries.js called getSessionData how can I import this into my hooks.js
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai What are the different types for the additional signup fields and where can I see these types in the codebase. For example, there's type input.
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai Ok now that I added the terms of service to the addtional signup fields how do I add the terms of service as a check box to this :
export function CreateAccount() {
return (
<Layout>
<SignupForm
additionalFields={[
{
name: 'firstName',
label: 'First Name',
type: 'input',
validations: {
required: 'First name is required',
},
},
{
name: 'lastName',
label: 'Last Name',
type: 'input',
validations: {
required: 'Last name is required',
},
},
{
name: 'address',
label: 'Address',
type: 'input',
validations: {
required: 'Address is required',
},
},
{
name: 'phoneNumber',
label: 'Phone Number',
type: 'input',
validations: {
required: 'Phone number is required',
},
}
]}
/>
</Layout>
)
}
Where checked means true and unchecked means false for the database and the user can't proceed without terms of service checked
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai Should I add the terms of service as a boolean to my signup.js where my additional signup fields are and then take it from there? Because that's how it is in my user mode.
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai Ok I got it the email thing to work by adding email to the additional signup fields. Now my next issue is that I want there to be a terms of service check box. But this isn't some field to input I need there to be a check box. Can I also add this to additional signup fields? and if so how?
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai I'm still getting this error:
PrismaClientValidationError:
[ Server!] Invalid prisma.user.create() invocation in
[ Server!] /Users/rithvikprakki/helios_nexus_website/.wasp/out/sdk/wasp/auth/utils.ts:145:22
Argument email for data.email is missing.
[ Server!]
[ Server!] Note: Lines with + are required, lines with ? are optional.
[ Server!]
[ Server!] at Ui.validate (/Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:148:73)
[ Server!] at gn.createMessage (/Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:164:1298)
[ Server!] at /Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:177:11600
[ Server!] at Object.runInChildSpan (/Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:174:1394)
[ Server!] at t._executeRequest (/Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:177:11577)
[ Server!] at signup (/Users/rithvikprakki/helios_nexus_website/.wasp/out/server/src/auth/providers/email/signup.ts:122:20)
[ Server!] at <anonymous> (/Users/rithvikprakki/helios_nexus_website/.wasp/out/sdk/wasp/server/utils.ts:26:5) {
[ Server!] clientVersion: '4.16.2'
[ Server!] }
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai Should I add email to the User model in schema.prisma because I have it added right now and that might be the issue
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai I did the things you said and now I'm getting this error:
PrismaClientValidationError:
[ Server!] Invalid
prisma.user.create()
invocation in
[ Server!] /Users/rithvikprakki/helios_nexus_website/.wasp/out/sdk/wasp/auth/utils.ts:145:22
Argument email for data.email is missing.
[ Server!]
[ Server!] Note: Lines with + are required, lines with ? are optional.
[ Server!]
[ Server!] at Ui.validate (/Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:148:73)
[ Server!] at gn.createMessage (/Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:164:1298)
[ Server!] at /Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:177:11600
[ Server!] at Object.runInChildSpan (/Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:174:1394)
[ Server!] at t._executeRequest (/Users/rithvikprakki/helios_nexus_website/node_modules/@prisma/client/runtime/library.js:177:11577)
[ Server!] at signup (/Users/rithvikprakki/helios_nexus_website/.wasp/out/server/src/auth/providers/email/signup.ts:122:20)
[ Server!] at <anonymous> (/Users/rithvikprakki/helios_nexus_website/.wasp/out/sdk/wasp/server/utils.ts:26:5) {
[ Server!] clientVersion: '4.16.2'
[ Server!] }67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai
No wait. I put this:
userSignupFields: import { userSignupFields } from "@src/pages/signup",
in my main.wasp
and I have this in my src/pages/singup.js:
import { defineUserSignupFields } from 'wasp/server/auth'
export const userSignupFields = defineUserSignupFields({
address: (data) => {
if (!data.address) {
throw new Error('Address is required')
}
return data.address
},
phoneNumber: (data) => {
if (!data.address) {
throw new Error('Address is required')
}
return data.address
},
firstName: (data) => {
if (!data.address) {
throw new Error('Address is required')
}
return data.address
},
lastName: (data) => {
if (!data.address) {
throw new Error('Address is required')
}
return data.address
}
})
I have this component here:
import {
LoginForm,
SignupForm,
VerifyEmailForm,
ForgotPasswordForm,
ResetPasswordForm,
} from 'wasp/client/auth'
export function CreateAccount() {
return (
<Layout>
<SignupForm />
</Layout>
);
}
However, when I go to the signup page on my website only two fields are visible instead of all of them. Why is that happening?
67 replies
WWasp-lang
•Created by RPD on 9/15/2024 in #đŸ™‹questions
Replacing Wasp's Auth UI, while keeping the functionality
@kapa.ai Ok So I put in my main.wasp that there are additional form fields:
` auth: {
userEntity: User,
methods: {
email: {
userSignupFields: import { userSignupFields } from "@src/pages/signup",
fromField: {
name: "Helios Nexus",
email: "[email protected]"
},
emailVerification: {
clientRoute: EmailVerificationRoute,
},
passwordReset: {
clientRoute: PasswordResetRoute,
}
},
},
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/"
},
67 replies
WWasp-lang
•Created by RPD on 9/9/2024 in #đŸ™‹questions
My website isn't showing up when I run wasp start
Thanks for all the help I figured it out it was just an issue in the code that only showed up in the console
8 replies