new params when calling trpc
im building new project and using the newest create.t3.app and came across this new params, can anyone tell me what is this?
thankss
9 Replies
it makes it so that the getSecretMessage query is only enabled if there is an authenticated user
so with that in place i can check the user role, right?
and dont need this middleware?
You still want to check serverside using middleware
Else someone could just type the url in their browser and it wouldnt be protected
so if dont write the 'enabled' params, is it ok?
yea
ahhh oke thanks juliusđź‘Ť
it would just hit your middleware and error on the way
so the enabled prop is there to "delay" the query until we actually have an authed user so we don't get a bunch of errors in the console
i think that was the main driver for it - since a lot complained about their consoles getting errors on a fresh app since they weren't logged in
ok i think i understand 🫡