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

The `protectedProcedure` doesn't seem protected?

It seems that all the function does, is check whether we've sent a username.
I have enabled "strategy: "jwt" in next-auth, so my understanding is that NextJS encrypts the token it's received from auth provider, and now uses this to determine whether we're logged in etc. In terms of making authenticated requests, should we not be doing something like decrypting the access_token in the protectedProcedure handler, and getting the user / scope from that, and then assume the user is actually who they say they are (rather than trusting the client who could send any username)...

Want to create a collaborative editor with Next.js

I am currently trying to figure out yjs with next.js. Are there any better alternatives for react based applications?

T3 Stack Next - Correct method for automating functions every X mins

When using GoogleFu, the usual results are setInterval and run endlessly, but is that the correct method for things happening every 10 minutes for like.. multiplicative datasets? Additionally, is best practice to offload this from the T3 stack and run a separate program? Thanks for all the help!...

After a user submits their email to next-auth, how to pass it to the check email page?

question with next-auth email provider. After a user submits their email, they get sent to the check-email page.... How can I pass that email address through to the check email page?...

A very basic thing that can not be done right using NextAuth?

I have an app that uses DB sessions. I've got an /admin route that I want to protect using a Next.js middleware by checking the user's role, but I can't do this because I don't have access to 'user' obj. How can I do this right without having to copy-paste a block of getServerSideProps?...

Auth solution for encrypting, not hashing, passwords

I'm working on an application where a user signs up with identical credentials from another website. We then use that password to scrape that website (with permission) and display data on web and mobile apps. Are there 3rd party auth providers who allow you to encrypt a user's password instead of hashing it? I've looked around for a bit and I'm not sure if I can access a user's password from Auth0 or Clerk.dev....

First Prisma thing with next-auth

Hi guys, I'm trying to get started with prisma, and i thought on eof the first thigns i should do was to add a logins count to the user's account .... Im just getting a simple "ERROR" ...

serverless background jobs?

any cool services or providers to enable something like enqueuing jobs in a way that makes sense for a serverless stack? this is a side project so i just want to try options...

Quick Config Question

Id appreciate a quick explanation of what the @type is here? I see this in a a lot of config files. Is it JSDoc? Is it typescript stuff? A mix it seems? Do we only add it for autocomplete on the config object? Is visual studio code automatically doing this somehow? Thanks...

Need help with setting up prisma schemas

so basically I want a user to be able to create and join events. I've set up a way to identify the host of an event, but not how to keep track of the members of the event (those who join the event). I kept getting some errors when I tried to implement it myself and it was hard to keep track of them so i got rid of what i had cause it was not working. What is a good way of keeping track of Users who join the event? ```js model User { id String @id @default(cuid()) name String?...

electron

I decided to build a mono repo with a desktop app built in nextron (electron + next.js). Found that nextAuth TwitchProvider doesn't work in chromium browser. Twitch website is not compatable with nextAuth TwitchProvider. Is there anyway around this? Or do I need to say goodbye to nextAuth

should I use state with tRPC

Hi, this may be a dumb question, but I can't seem to find a proper answer on Google. I am creating a simple t3 app that stores values in a database and then displays them on a grid. I am using tRPC, using a useState to store the data, and modifying the state on mutation success for example. Is this how I am supposed to do it or is there a way to do it without the useState, using directly the tRPC data and refetching on mutation?

API Layer abstraction

Is it good idea to have the api folder abstracted inside the shared packages folder when working with Next.js in a monorepo architecture, if not what are some of the ways In which we can abstract the api layer

tRPC SSG - Page rendering error

Hey 👋 I just set up tRPC with SSG to prefetch some data in getServerSideProps. I get this error when I try to load the page. Any ideas? Thanks....

How to add more keys to session with next auth

how do i add more keys to the session which next auth creates thank you...

upload image using supabase

does anyone had a method to upload multiple image and save it to db using trpc endpoint? (im using supabase) thanks in advance...

Save me from git

When I do: "git commit -m "initial commit"" It says it tries to track files that are not in my actual folder, but the files from my user folder! I have a git config in my user folder that I just edited, maybe that made it happen somehow. Anyone has any idea what to do with this sh*t?...

Best way to force Vercel build to fail If certain code is included?

Does anyone know a way to force a Vercel build to fail if a certain piece of code exists?

useQuery refetching doesn't re-render?

Is this expected behavior? I can't find anything about it online, but I really thought it would make sense to force a re-render similar to when updating a state in the component. Can someone help me figure out the conventional way of re-rendering when useQuery hook refetches and gets new data?

How to setup and teardown database records when running integration tests with trpc?

Currently, I'm doing this but it seems impractical to do with more tables in the database. Is there an alternative approach? ```ts afterEach(async () => { const ctx = await createContextInner({ session: null,...