Wasp

W

Wasp

Join the community to ask questions about Wasp and get answers from other members.

Join

Is it possible to inject custom data into the context object with middleware?

I'm looking to implement the concept of Organizations with Roles and Permissions. I've seen this gist linked in a few discussions which seems like a nice starting point for how to organize the DB schema. I'm trying to figure out the best way to implement the backend. My current thought is to write custom middleware to check the user's selected organization and enrich the context object with the user's role and permissions to be passed into my Queries and Actions. If the user is not enrolled in the organization then the middleware would reject the request. Is this possible with Wasp? If not, any suggestions for the best way to approach this the "Wasp way"? I'd like to avoid writing custom apis for everything....

Hi guys, I have a question about Client / Server functions.

My app is currently running at the client level. The client api calls are all pointed to the public url. I want to change it so the client calls function on the server. I want the client to send a text string from an input box to a server function. then the client waits for a response. I can provide the current working code if you think it would help.

signup() not accepting custom fields in Typescript

I am having hard time to successfully write a custom signup page in Typescript. I followed the details on the Customizing the Signup Process and the Defining Extra Fields documents. I have defined my own custom component for the signup form, defined the userSignupFields object, all as described. However, unlike the example provided when I try to call the signup() function with any additional fields other than email and password, for instance firstName, I get the error: ``` [ Wasp ] ext-src/auth/SignupPage.tsx(83,9): error TS2353: Object literal may only specify known properties, and 'firstName' does not exist in type '{ email: string; password: string; }'....

Query with multiple entities

Hey everyone! 👋 I'm trying to work with multiple entities in a Wasp query and running into some TypeScript issues. Here's my query definition: ```ts query getActiveGames {...

Issue migrating to Wasp TypeScript config

Hi! I'm encountering an issue migrating my Wasp v0.15.0 proejct to the new Wasp TypeScript config. I'm following the guide in the docs (https://wasp-lang.dev/docs/general/wasp-ts-config) but running into an issue at step 8: ...

Moving to cookie based sessions?

I'm not a fan of the JWT with localstorage managing the authorization system. Does anyone with some deeper understanding of the auth systems want to give me some jumping off points for implementing the cookie based session system? I see it uses Lucia. End goal would be a PR of a system of choosing between JWT+localstorage or standard cookie sessions.

What's the best way to run fly deploy with arguments?

I'm trying to run wasp deploy fly deploy --depot=false to work around an issue with flyctl depot https://community.fly.io/t/hanging-on-waiting-for-depot-builder/23674 When I run fly alone i get other errors which tells me i'm missing somehting: ```fly deploy -a block-spot-client
==> Verifying app config...

Why is my project not recompiling after file change?

Why is my project not recompiling after file change?

SEO issue . Twitter or facebook cannot recognise meta tags

I need different meta tags for the pages so that they are currently recognised as cards and shared properly on twitter or facebook. Both of the platforms don't identity proper card information . This is the example page https://dappermark.com/page-curations/3ef6c26c-28e5-4092-a5ef-36f8bc4e2cb9 ...

is @everyone able to jump on a call and help me deploy to fly.io?

ive never dealt with deployments, mainly did front/backend development, and the basic wasp deploy fly launch my-wasp-app mia keeps throwing all sorts of issues upd: Issued ive encountered:...

Deploy lower version of wasp

``` name: myapp on: push:...

Wasp TS SDK package

Quick question why wasp-config package https://github.com/wasp-lang/wasp/tree/v0.16.0/waspc/packages/wasp-config is not published on npm direcly? but installed as link to wasp installed in system

useParam issue

hi i got todo app to work but cant get an app created by mage to work. Here is the error i am seeing in the browser dev console... ChatRoom.jsx:2 Uncaught SyntaxError: The requested module '/@fs/Users/ethan/projects/lisa/mage/.wasp/out/sdk/wasp/dist/client/router/index.js' does not provide an export named 'useParams' (at ChatRoom.jsx:2:10)...

Fly io Region or any alternatives?

I am about to lunch a beta micro saas and i am currently planning to focus Russia + Middle East market but as you see fly io regions has big gap around that area, I haven't played with fly io do you think this is going to be a problem in the future if I use fly io? or do you guys recommend another fullstack hosting platform?
No description

What typescript type for queries that use "include"?

Normal behavior: When my query just returns an object from the database, Wasp automatically includes the proper Typescript type for me, like this: ``` export const getDecks: GetDeck<any, Deck[]> = async (args, context) => { return context.entities.Deck.findMany({ where: {...

How to get auth to trigger on a button

Hey @Kappa, I’m sure you know the answer to this, but I’m working with Wasp and it's pretty easy to require authentication for a page. However, I want my users to be able to access a page (a mechanical engineering calculator), but only require them to log in when they click the "Calculate" button to run the calculation (note i also want to save the inputs so that when they log in they dont lose them). Additionally, I want new users to get 3 free tokens (calculations) before they need to purchase a subscription. Let’s focus on the authentication part for now, but I think Wasp might have a good solution for the token system as well....

Reply to chat socket on insert to DB table or an API call from external service.

My use case is that using the socket given by wasp I have set up a chat bot. Now to respond back the reply message is generated in aother microservice which updates the shared table in postgres. It can also do a API call to any action we write in Wasp. My challenge is how to trigger the socket to emit event and point to correct client as everything is async. has anyone done this before. Please point me to correct examples if possible .

onBeforeSignup not erroring out

How can I break out of the signup process when doing a onBeforeSignup and it returns an error I see this in the documentation
Wasp ignores the hooks' return values. The only exception is the onBeforeOAuthRedirect hook, whose return value affects the OAuth redirect URL.
https://wasp-lang.dev/docs/auth/auth-hooks#using-hooks...

How do I access Prisma Studio for my Wasp app that I've deployed on Fly.io?

Hi all, like the title asks, how can I access the Prisma Studio to view / modify database records for a Wasp app that's been deployed to Fly.io?