Joaquim
Joaquim
WWasp
Created by khb on 11/23/2024 in #đŸ™‹questions
Oauth not working for google or github.
Nice, I'm glad I was able to help:)
16 replies
WWasp
Created by khb on 11/23/2024 in #đŸ™‹questions
Oauth not working for google or github.
No description
16 replies
WWasp
Created by khb on 11/23/2024 in #đŸ™‹questions
Oauth not working for google or github.
Nop. WASP_SERVER_URL correctly points to https://my-site-engineer-server.fly.dev which is where your backend is running. In authorized redirect URLs, where you are setting up google oauth, instead of using siteengineer.com.au, use my-site-engineer-server.fly.dev
16 replies
WWasp
Created by khb on 11/23/2024 in #đŸ™‹questions
Oauth not working for google or github.
The oauth redirects go through the backend. And I'm guessing that domain is your frontend domain. As the authorized redirect domain, set the one you use as the backend domain. It seems like it's the fly generated one that you see in your error message
16 replies
WWasp
Created by Joaquim on 11/19/2024 in #đŸ™‹questions
Docs on LEMONSQUEEZY_STORE_ID missing
Yeah correct, it's totally fine. Didn't know if you guys wanted that explicit or not so posted it here. I was getting a 404 during createCheckoutSession and had to debug some 5 minutes
10 replies
WWasp
Created by Joaquim on 11/19/2024 in #đŸ™‹questions
Docs on LEMONSQUEEZY_STORE_ID missing
Sorry if this is not the place for it
10 replies
WWasp
Created by Prefix on 11/18/2024 in #đŸ™‹questions
Redirect user if authenticated?
I have something like this in my app
const navigate = useNavigate();
const location = useLocation();
const { data: user, isLoading: userIsLoading } = useAuth();

if (userIsLoading) {
return null;
}

if (user && (location.pathname === "/" || location.pathname === "/login")) {
navigate("/indices", { replace: true });
return null;
}
const navigate = useNavigate();
const location = useLocation();
const { data: user, isLoading: userIsLoading } = useAuth();

if (userIsLoading) {
return null;
}

if (user && (location.pathname === "/" || location.pathname === "/login")) {
navigate("/indices", { replace: true });
return null;
}
It's encouraged in the react docs to run state changes during render if you guarantee that it only runs once. It prevents the useEffect delay
8 replies
WWasp
Created by Prefix on 11/18/2024 in #đŸ™‹questions
Redirect user if authenticated?
I would not run anything inside a useEffect. Take the user and the loading status from useAuth. If it's loading return a loading screen. If it's not authenticated, return null and navigate to the page you want
8 replies
WWasp
Created by Joaquim on 11/15/2024 in #đŸ™‹questions
Adding svgr plugin to the vite config
Hm perfect indeed. I must be screwing up somehow. I'll also replicate from a new project and compare the build folder. I'm at work, but will let you know how it went later. Thanks a ton for the help. At least i know it works.
10 replies
WWasp
Created by Joaquim on 11/15/2024 in #đŸ™‹questions
pg-boss can't find certificates
Yesterday I was in "please god just let it deploy" mode so I don't remember exactly what worked and I don't want to redo the process right now. I don't think I was able to pass the certificate to pg boss. Ended up setting "ssl":{"rejectUnauthorized":false} in PG_BOSS_NEW_OPTIONS and removing the certs path from pgboss url connectionString. So now I have ssl in my webapp connection to my db but pgboss, that also runs in the same machine, doesn't:p Need to fix that when I have the time.
7 replies
WWasp
Created by Joaquim on 11/15/2024 in #đŸ™‹questions
Access folder in project root from dockerfile
Deploying to fly.io using wasp deploy fly deploy (not launch). But yeah I guess I can run wasp build, copy the certs to .wasp/build and run wasp deploy fly deploy! This makes sense right? Thanks
10 replies
WWasp
Created by abiroot on 11/5/2024 in #đŸ™‹questions
I need help in debugging resource exhausted (Too many open files)
It also happens to me with wasp build if I don't ulimit -n 200000
16 replies
WWasp
Created by Joaquim on 11/15/2024 in #đŸ™‹questions
Access folder in project root from dockerfile
I don't think option 1 works because the root folder dockerfile is just appended to the built dockerfile. So, the directory of the docker build will still be .wasp/build
10 replies
WWasp
Created by Joaquim on 11/15/2024 in #đŸ™‹questions
Adding svgr plugin to the vite config
Yeah for sure! This is what I do. I'm unsure on what happens during the build process though... I have to think more about it Run: npm install --save-dev vite-plugin-svgr
// vite.config.ts
import { defineConfig } from "vite";
import svgr from "vite-plugin-svgr";

export default defineConfig({
plugins: [svgr()],
server: {
open: true,
},
});
// vite.config.ts
import { defineConfig } from "vite";
import svgr from "vite-plugin-svgr";

export default defineConfig({
plugins: [svgr()],
server: {
open: true,
},
});
Download an icon like: https://www.svgrepo.com/download/535115/alien.svg somewhere into src/ import it anywhere in react like: import Icon from "./src/icon.svg?react For typescript safety, not sure if it's required to replicate well:
// vite-env.d.ts
/// <reference types="vite-plugin-svgr/client" />
// vite-env.d.ts
/// <reference types="vite-plugin-svgr/client" />
10 replies