cmilazzo
cmilazzo
WWasp-lang
Created by cmilazzo on 10/16/2024 in #🙋questions
add stripe
How do I add stripe support to an existing project created using Mage without Stripe?
5 replies
WWasp-lang
Created by cmilazzo on 10/16/2024 in #🙋questions
Google auth configFn and userSignupFields
When I add either of these functions to my main.wasp, I get errors. My google auth method looks like this:
google: { configFn: import { getConfig } from "@src/pages/auth/google.jsx", userSignupFields: import { userSignupFields } from "@src/pages/auth/google.jsx" }, I have a google.jsx file created under src/pages/auth/google.jsx with the following: import { defineUserSignupFields } from 'wasp/server/auth' export const userSignupFields = defineUserSignupFields({ displayName: (data) => data.profile.name, address: (data) => { if (!data.address) { throw new Error('Address is required') } return data.address }, phone: (data) => data.phone, })
export function getConfig() { return { scopes: ['profile', 'email'], } }
8 replies
WWasp-lang
Created by cmilazzo on 10/15/2024 in #🙋questions
google auth
I created an app using mage, and didn't include google authentication. I would now like to add that functionality. What is the simplest way to add that functionality?
31 replies
WWasp-lang
Created by cmilazzo on 10/11/2024 in #🙋questions
is it good practice to call an action from an api?
is it good practice to call an action from an api? If so, should it be done?
6 replies
WWasp-lang
Created by cmilazzo on 10/10/2024 in #🙋questions
delete entity
I have an entity called File which has an id. Give me an example action to delete a File
14 replies
WWasp-lang
Created by cmilazzo on 10/10/2024 in #🙋questions
Error handling in actions
How do you safely throw an exception from an action without crashing the server but make sure to notify the client?
4 replies
WWasp-lang
Created by cmilazzo on 10/10/2024 in #🙋questions
primitive type returns in action
Is there a way to return a string in an action? I've tried just adding it to the return statement, but typescript complains. I've also tried adding a returns: { file: File, key: string } statment to my action (I'm already returning a File entity as well). Is this even possible, or do I need to create a separate entity just to return the string?
13 replies
WWasp-lang
Created by cmilazzo on 10/5/2024 in #🙋questions
Meta tag in head
@kapa.ai How would I add a meta tag to the head of the document in the web-app?
5 replies
WWasp-lang
Created by cmilazzo on 10/4/2024 in #🙋questions
CORS issue on authentication
I have a server set up with the API running on port 448 (https). I'm getting this error: Access to XMLHttpRequest at 'https://thehatchery.io:448/auth/me' from origin 'https://thehatchery.io' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
9 replies
WWasp-lang
Created by cmilazzo on 10/2/2024 in #🙋questions
wasp build
What command should I use to build the wasp application if I have REACT_APP_API_URL=https://thehatchery.io:448 and WASP_SERVER_URL=http://thehatchery.io:3001
14 replies
WWasp-lang
Created by cmilazzo on 10/1/2024 in #🙋questions
recommended ssl configuration for api server
@kapa.ai I am installing a prduction Wasp server with nginx as a proxy server. I've configured port 80 and 443 on nginx to forward to port 3000 on the wasp server. However, authentication fails because the client REACT_APP_API_URL is set to port 3001. I believe I should change this to https (port 443) but doing so causes the following error: "useAuth.ts:23 GET https://thehatchery.io:3001/auth/me net::ERR_SSL_PROTOCOL_ERROR" How should I be configuring the port forwarding and listening here, and what should my ENV variables be pointing to?1
43 replies
WWasp-lang
Created by cmilazzo on 10/1/2024 in #🙋questions
Websocket connection to server fails
In my client I am seeing an error "WebSocket connection to 'ws:3.12.219.195' failed". Is this something to worry about? Do I need to ensure a websocket port is open?
8 replies
WWasp-lang
Created by cmilazzo on 9/30/2024 in #🙋questions
redirect after login
after authenticating with /auth/me the app is redirecting to my landing page, which has a history.push() to go to the logged in dashboard page. However, that means the logged in user can no longer get to the main page. Is there a way to change the default location users are directed to after authentication?
6 replies
WWasp-lang
Created by cmilazzo on 9/29/2024 in #🙋questions
rebuild project on file change
Is there a way to force wasp to rebuild all the code without having to do a full clean? Replacing all the node modules takes way too long!
13 replies
WWasp-lang
Created by cmilazzo on 9/29/2024 in #🙋questions
known issue with reloading web app?
Frequently when I make a change to the dev code (or even deploy a new version to my production system) it will recompile, but not actually load the new code. As a test I simply put a console.error() call in to frequently used section of code. and let the auto-updater recompile. I always see this in my wasp output : 🐝 --- Recompiling on file change... ----------- However, this sometimes results in no changes (i.e. the error message does not get displayed). The problem will persist until I do a wasp clean.
25 replies
WWasp-lang
Created by cmilazzo on 9/29/2024 in #🙋questions
production deployment port
I'm deploying my wasp app to an Amazon EC2 instance. I've set up nginx as a reverse proxy for port 80 to port 3000. However, when I attempt to login I get an error message stating: "Access to XMLHttpRequest at 'http://localhost:3001/auth/username/signup' from origin 'http://3.12.210.195' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space local." Where is the "localhost" part of this auth path set, and do I need to open port 3001?
14 replies
WWasp-lang
Created by cmilazzo on 9/28/2024 in #🙋questions
HTTP port
Hi there. Any pointers on how to change the HTTP and HTTPS ports the server is listening on? 3000 and 3001 don't work for me.
16 replies
WWasp-lang
Created by cmilazzo on 9/27/2024 in #🙋questions
ssl cert
@kapa.ai How do I add a ssl certificate to my wasp app
7 replies
WWasp-lang
Created by cmilazzo on 9/27/2024 in #🙋questions
self-signed cert
how do I add a self signed cert to my Wasp app?
10 replies
WWasp-lang
Created by cmilazzo on 9/27/2024 in #🙋questions
add react component
How can I add a new react Component to my page. I've tried adding a new .tsx file (I called it WordCloud.tsx" in the @src folder, and importing it to my page using "import { WordCloud } from '@src/WordCloud';" However, the import is not working. Do I need to add another reference somewhere to get wasp to recognize the new .tsx?
23 replies