chip
chip
Explore posts from servers
TTCTheo's Typesafe Cult
Created by chip on 2/18/2024 in #questions
Input components for log searching / multiselect
Does anyone know of any good or just know of some libraries outside of react-select that could help with creating an input for log searching. Think about Vercel's log searching, or Datadag 🙂
5 replies
TTCTheo's Typesafe Cult
Created by chip on 2/4/2024 in #questions
What to use for storage of logs from SaaS
Yo! I am building a SaaS for game servers, and I want to provide logging as well. I have currently been pepega and stored some simple logs in my database while testing, but with more complex data and search, it's not going to scale nor work very well in the long run. I've been looking at both stuff from Elasticsearch and Algolia, but does anyone have any other services that might be worth looking into? 🙂
5 replies
TTCTheo's Typesafe Cult
Created by chip on 10/26/2023 in #questions
Http cancellation with Vite proxy server not picked up by backend
I've been trying to figure out why my backend wont' pick up http reqs canceled by the frontend, and I've realized that it is because of Vite proxy server:
export default defineConfig({
plugins: [react(), mkcert()],
build: {
outDir: "../server/server/dist",
emptyOutDir: true,
},
base: "/",
resolve: {
alias: {
"@": "/src",
},
},
server: {
open: true,
port: 3000,
proxy: {
"^/api": {
target: devProxyServer,
changeOrigin: true,
},
},
},
});
export default defineConfig({
plugins: [react(), mkcert()],
build: {
outDir: "../server/server/dist",
emptyOutDir: true,
},
base: "/",
resolve: {
alias: {
"@": "/src",
},
},
server: {
open: true,
port: 3000,
proxy: {
"^/api": {
target: devProxyServer,
changeOrigin: true,
},
},
},
});
This only happens in dev locally, as the frontend is hosted in the backend in prod, but has anyone else encountered the same thing and able to give some pointers? I'm at the point where I just want to figure it out 😛 PS: Calling fetch with the absolute path to the backend works (backend picks it up), but not something we can do 😦
2 replies
TTCTheo's Typesafe Cult
Created by chip on 2/27/2023 in #questions
[next-auth] Updating user model with new values after oauth signin
Maybe someone can give some pointers on this Let's say we have this flow 1. User tries to access an protected route 2. Is redirected to /login with an callbackUrl for the protected route and isSubmitting url query 3. Chooses to login with an oauth provider with the same callbackUrl as when they were redirected to /login After/or inbetween they login in with an oauth provider, I want to set a column in the User model ("role") to "some value" based on the "isSubmitting" url query Does anyone know how one could accomplished that? Right now, I've been thinking about creating another route where the user is redirected to after login, grab the callbackUrl, which then would look something like "/afterlogin?callbackUrl=url&isSubmitting=true", but if this is supposed to work, the callbackUrl on the "signIn" function would also look odd, as it would be a callbackUrl with a callbackUrl inside of it 😄 That seems a bit ehh? Any ideas?
4 replies
TTCTheo's Typesafe Cult
Created by chip on 1/28/2023 in #questions
Clerk auth
Curious to hear what people have to say about Clerk, and if anyone have experienced any issues, or challenges while using it. Mainly for Expo now. I am looking into it now that I want more auth providers other than just email/password, and I want to hear from someone how's been using it for a while 🙂
1 replies
TTCTheo's Typesafe Cult
Created by chip on 1/15/2023 in #questions
JWT and refresh tokens
I need some advice on how to handle refresh tokens 😦 Is it "good enough" if I generate two JWT tokens (accessToken, refreshToken), and let the resfrehToken just contain one claim, being the userID? And whenever I do a api call from the client and it returns a 401, I then call a /refresh api call, to get a new accessToken and retry the request - as long as the refreshToken is valid?
26 replies