Hastur
Hastur
WWasp-lang
Created by Hastur on 10/7/2024 in #đŸ™‹questions
Can't make onAfterLogin work
Hello, I updated wasp because I need this specific hook in my project but I really can't make it work. Here is my app/src/auth/hooks.ts file:
import type {
OnAfterLoginHook
} from 'wasp/server/auth';

export const onAfterLogin: OnAfterLoginHook = async ({
providerId,
user,
oauth,
prisma,
req,
}) => {
console.log('test');

try {
await prisma.logs.create({
data: {
message: 'test',
level: 'test onAfterLogin',
},
});
} catch (error) {
console.error('Error updating Log.', error);
}

try {
await prisma.user.update({
where: {
id: user.id,
},
data: {
username: 'vdssd'
}
});
} catch (error) {
console.error('Error updating user.', error);
}
};
import type {
OnAfterLoginHook
} from 'wasp/server/auth';

export const onAfterLogin: OnAfterLoginHook = async ({
providerId,
user,
oauth,
prisma,
req,
}) => {
console.log('test');

try {
await prisma.logs.create({
data: {
message: 'test',
level: 'test onAfterLogin',
},
});
} catch (error) {
console.error('Error updating Log.', error);
}

try {
await prisma.user.update({
where: {
id: user.id,
},
data: {
username: 'vdssd'
}
});
} catch (error) {
console.error('Error updating user.', error);
}
};
Nothing appears in the console and the database is not updated. Could you please help me?
7 replies
WWasp-lang
Created by Hastur on 9/30/2024 in #đŸ™‹questions
What is the best way to update from 0.14.0 to 0.14.2?
Hello, I would like to know what is the best way to update to 0.14.2? Is the best way creating a new wasp app and just copy/paste my /app/src/ folder in it? Thank you!
8 replies
WWasp-lang
Created by Hastur on 9/25/2024 in #đŸ™‹questions
How to override the title, meta properties and description?
Hello, My app is practically finished but I just noticed that there seems to be no way to change the titles of the pages, the meta tags or the description as they are set once for the whole app. I mean, I understand that it is supposed to be a simple SaaS app but relying on Astro for adding simple pages (legal notices, one-page doc) is way overkill and, in my opinion, kills a lot of the simplicity of Wasp. So is it possible to override titles and description? Thank you.
8 replies
WWasp-lang
Created by Hastur on 7/28/2024 in #đŸ™‹questions
Issue with Stripe webhook testing using CLI
Hi, I am trying to test payment intent in local using Stripe CLI. I have followed both pages from the doc (Stripe Integration and Stripe Testing). But, when I am testing using the following command: stripe trigger payment_intent.succeeded --api-version 2022-11-15 I have this in the other terminal listening for the webhook: 2024-07-28 15:09:09 --> charge.succeeded [evt_3PhWqWCWXwZlQqXs0YgFiPrS] 2024-07-28 15:09:09 <-- [404] POST http://localhost:3000/stripe-webhook [evt_3PhWqWCWXwZlQqXs0YgFiPrS] 2024-07-28 15:09:09 --> payment_intent.succeeded [evt_3PhWqWCWXwZlQqXs094ZSBa6] 2024-07-28 15:09:09 <-- [404] POST http://localhost:3000/stripe-webhook [evt_3PhWqWCWXwZlQqXs094ZSBa6] 2024-07-28 15:09:09 --> payment_intent.created [evt_3PhWqWCWXwZlQqXs0REC6Omq] 2024-07-28 15:09:09 <-- [404] POST http://localhost:3000/stripe-webhook [evt_3PhWqWCWXwZlQqXs0REC6Omq] 2024-07-28 15:09:24 --> charge.succeeded [evt_3PhWqmCWXwZlQqXs17CkZkYq] 2024-07-28 15:09:24 <-- [404] POST http://localhost:3000/stripe-webhook [evt_3PhWqmCWXwZlQqXs17CkZkYq] 2024-07-28 15:09:25 --> payment_intent.succeeded [evt_3PhWqmCWXwZlQqXs1xjv7iER] 2024-07-28 15:09:25 <-- [404] POST http://localhost:3000/stripe-webhook [evt_3PhWqmCWXwZlQqXs1xjv7iER] 2024-07-28 15:09:25 --> payment_intent.created [evt_3PhWqmCWXwZlQqXs15SSlCsC] 2024-07-28 15:09:25 <-- [404] POST http://localhost:3000/stripe-webhook [evt_3PhWqmCWXwZlQqXs15SSlCsC] The API version is matching the one in @src/payment/stripe/stripeClients.ts, the port is the good one (the one running the app) and the path to the webhook is the one defined in the wasp config file with httpRoute: (POST, "/stripe-webhook"). I don't understand what could go wrong. But, when I go to dashboard.stripe.com/test/logs, I can see my requests listed as: POST /v1/payment_intents 200 OK API Version 2022-11-15 So maybe it worked but the CLI is giving me an error? I guess the dashboard logs page is more thrustworthy?
5 replies