Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

TRPC cache (with vercel, but not working locally too)

Hello. I am using TRPC to make a site which integrates with a third party API. I need to add caching to some of my routes. ...

What is the best practice for unstable_getServerSession()?

What is the best practice for unstable_getServerSession()? Should I get the data using getServerSideProps in a layout and do a state drill? Or return the data with unstable_getServerSession() in getServerSideProps for each component it needs?

Is it safe to save user role in JWT token with NextAuth?

Hello, When using the JWT strategy, NextAuth puts the user role automatically in the token. Is this safe to do? If I google it, its a bit of a yes-no answer. If I look at Cal.com, they even put more information in it. I want to use the role only to check if authenticated user is allowed to visit a specific page. Of course, everytime a user does an action, it will be checked if the user is allowed via a middleware....

What's the correct place to put code that populates the db with default values?

I need to populate a table with some rows when the app deploys

How to modify useSession data type?

I am using credentials and providers then returning user, I was trying to put some user infos into session but session.user always returning ```{ user: { name: '1234', email: 'c@b.com', image: null,...

Next Auth JWT

Hello, I have 3 questions regarding NextAuth with JWT as session strategy: 1. When I return in the authorize function something like ```ts...

Session_ID in JWT

In my app I use JWT so I can verify that the token has not been tampered with, however the only information I store in it is the user's session_id. Nothing else, no user data, just the session id. Should I be just using a cookie or something similar? Thankyou!...

How do I get and save the access token from discord oauth create-t3-app

Hi, I have been searching around for a solution to this for 3 hours now, I am probably retarded. I am trying to get all the guilds from discord, but I need the access token for authorization using next auth in my t3-app. When adding the token to the session call back it errors out. I tried to use the jwt call back along with the session call back to see if thats what was needed with no luck. Link to solutions that I have tried:...

T3 is severless, yet uses prisma— how...?

Still confused about how database connections work from short-lived workers. Is https://prisma.io/docs/data-platform/data-proxy the only way? Say you have a t3 fullstack vercel app and a railway DB. You don't just plug the DB url into prisma client, do you?...

Using a CMS with the t3 stack?

Say I'm building an e-commerce site and I need to give the client the ability to add/delete/edit products, should I use a CMS or just write this on my own? I looked into Sanity, but it looks like everything defined there is fetched via a REST api so I basically lose all the meaning of an end-to-end typesafety and type completions

Using copilot to refactor entire files?

Say you have a function called findBoobies() beneath it I can for example write: // rewrite findBoobies to use .filter() function findBoobies2 ......

should i store otp in session or database?

I regularly use database though During the nextauth signing process i check if the user has a otp first on the db then check if it has expired if expired send new one and delete old otp Else send the old otp that hasn't expired...

using tailwindui notification components

how to use the tailwindui notification to be use other components(passing message and show boolean)

Using T3 + Fastify + Bun ?

Hey, like the title says, is anyone using the T3 stack + bun + fastify? I'm curious to find out what the current 'bleeding edge' is which is how I got here and it seems like this is the stack....

How to fix error about getting id params in router when ssr is true

I want to make this page SSR for better SEO so currently i use like this ``` export const getServerSideProps: GetServerSideProps = async context => { return { props: {...

Optimistic Updates with TRPC (react-query)?

I am not sure how I would do optimistic updates with trpc? Is this "built-in" or do I have to use react-query's useQuery hook? So far, I am trying it like so, but it's not working: ```js...

abort signal

Where/which file do i put the line abortOnUnmount: true in the t3 stack? https://trpc.io/docs/aborting-procedures#trpcreact-query...

TRPC QueryClient access in ct3a?

I want to disable windows focus refetching globally like here: https://tanstack.com/query/v4/docs/guides/window-focus-refetching How do I access the queryclient in the scaffolded trpc in ct3a?...

getting this error in nextAuth

even after providing the clientId and secrets. what's going on here?

Examples of projects with custom and well designed Tailwind theme?

I am looking for some good examples to learn how to structure a design system on my T3 app with Tailwind. A designer has built a full design system (in Figma) that I need to translate into my NextJS app, and I was wondering if anyone has examples of repos that I can follow along with. I specifically want to have Tailwind Intellisense autocomplete a lot of the custom classes and variants I will be styling my components with. Maybe some larger companies are using Tailwind in there open source apps? I'm looking for more than just a boilerplate set up. Some app that has a fully built, custom UI is ideal. Any help would be appreciated. Thanks!...