Aerys
Aerys
Explore posts from servers
TtRPC
Created by Aerys on 12/17/2023 in #❓-help
How Do I Ban Users & Invalidate Their JWT Tokens?
When a malicious user gets banned by an admin, I have to ensure he no longer can access protected routes, but that means I have to query the database every time checking a user's token, is there a more efficient method for invalidating tokens?
4 replies
TTCTheo's Typesafe Cult
Created by Aerys on 12/17/2023 in #questions
How Do I Ban Users & Invalidate Their JWT Tokens?
When a malicious user gets banned by an admin, I have to ensure he no longer can access protected routes, but that means I have to query the database everytime checking a user's token, is there a more efficient method for invalidating tokens?
41 replies
TtRPC
Created by Aerys on 10/4/2023 in #❓-help
How to close a Standalone adapter server?
I want to run some integration tests with Vitest and for some reason I don't want to use the createCaller() API. Is there a way to close the Standalone server when tearing down the tests?
5 replies
TTCTheo's Typesafe Cult
Created by Aerys on 9/27/2023 in #questions
tRPC: Why useQuery() tries to refetch when error occurs while useMutation() doesn't?
I'm using the T3 stack.
test: publicProcedure.input(z.string().min(5)).query(async () => {
return "hi!";
}),
test: publicProcedure.input(z.string().min(5)).query(async () => {
return "hi!";
}),
const { error } = api.user.test.useQuery("test");
const { error } = api.user.test.useQuery("test");
(it should return a Zod validation error) the client tries to refetch 3 times and then returns the error (4-5 seconds of delay), throughout the process the error is logged by the loggerLink, but the error returned takes a while, but when I switch to useMutation() the error is returned rather instantly, what could be root?
6 replies
TtRPC
Created by Aerys on 9/27/2023 in #❓-help
Why useQuery() tries to refetch when error occurs while useMutation() doesn't?
I'm using the T3 stack.
test: publicProcedure.input(z.string().min(5)).query(async () => {
return "hi!";
}),
test: publicProcedure.input(z.string().min(5)).query(async () => {
return "hi!";
}),
const { error } = api.user.test.useQuery("test");
const { error } = api.user.test.useQuery("test");
(it should return a Zod validation error) the client tries to refetch 3 times and then returns the error (4-5 seconds of delay), throughout the process the error is logged by the loggerLink, but the error returned takes a while, but when I switch to useMutation() the error is returned rather instantly, what could be root?
5 replies
TTCTheo's Typesafe Cult
Created by Aerys on 9/24/2023 in #questions
Prisma and NextAuth: Additional fields in the `User` model
I have a system where users have to enter some additional information such username or birthday, NextAuth says that they should be defined as nullabe fields in the schema, but I don't want to, is there a way around this?
49 replies