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

use github for oauth not as my personal profile

i'm working on an app where github is the authentication measure. currently i have it working, but i feel like when signing up, people might be hesitant to login when oauth prompts the user with allow <my name> to do x y and z with your account, or whatever the message is. i'm just wondering how people generally do this- new github account? or is there a way around this? (this question also sort of applies for other oauth providers as im planning on adding more than just github, eventually probably even revoking github)...

WebSocket workflow for serverless with T3 stack

I'm just starting with WebSockets, and would like to get confirmation if I'm on the right track regarding how the communication between services is made. The basic pitch for the part of the project I want to discuss is the following: 2 users send information to the server. The information is only processed when both of them deliver their data, and then is sent back via a WebSocket subscription for both of them. Also, in order to process this new information to send to them, I need not only the data sent from both the users, but the previous processed information as well (this, I believe, means I'll need to store this processed information somewhere that is quickly retrievable so I can get it back in the next round of requests). The workflow I had in mind is like this: - User 1 makes a POST request for Next.js with the desired data - Next.js gets Redis' data to confirm if User 1 is the last to post in this round...

next-auth add sign in using github button to page instead of redirect

Hey, just like in the title, I want to add sign in button in the home page instead of default redirect page is it possible to do? Or is it just how next-auth works? Sorry if it is a stupid question but I couldn't find an answer to that.

session does not exist in SSR using with createProxySSGHelpers

Hello, I'm following TRPC docs and I want to fetch user decks in getServerSideProps using createProxySSGHelpers, but I'm getting 'UNAUTHORIZED' error am I missing something? it should be returned from createContextInner right? ```typescript...

How to fix "Invalid environment variables"

Error: Invalid environment variables

When to use next-auth

If I only plan on only using credentials i.e not using providers like discord, github, etc. Is it worth using next-auth or am I better of making my own custom authentication?

Sending additional info in the magic link auth token

Is it possible to pass additional data to the token that is sent for authentication via email magic links and when the email button is pressed and the signIn callback is called to also be able to process that token and that additional information that has been sent? And also for Google Oauth? #note: I am using database sessions...

Change image on hover in react project with tailwindcss

Hi, I am doing a project with react and tailwindcss, and I am having some problems: 1 - I need to change a image inside a button when I hover the button, but I dont have any idea on how to do it. 2 - I need to make a button than onClick it opens a little menu with 3 other buttons, and I dont know how to do it with Tailwind too. If someone have any ideia it would be very helpfull for me, thanks....

Any resources to learn the tRPC better? Hopefully with guides and examples?

Really struggling to learn otherwise in context of ct3 stack

Role is undefined when using NextAuth

Hello I am trying to create role based authorization and attempting to access the user's role from useSession in Next and from protected routes in trpc. I have added a UserRole to the user model in the prisma schema using an enum, and defaulted it to USER. Also in the server/auth ive added the role to Session and user interfaces and to the session callback. I have seen other people using a signIn or jwt callback and have no clue what they do or mean....

Examples on when to use + not use serverless?

Comp Sci senior here. I've been reading up on serverless deployment and I kind of understand what it is now. What I need some help with is understanding serverless functions, like general use cases, advantages, limitations, etc. I would greatly appreciate any examples of when to use SF vs standard managed-server deployment. Thanks!...

All of my tRPC requests returns 404 using create-t3-app.

Hey, guys! As the title says, I'm having a 404 for all my requests. It's my first time using create-t3-app and tRPC, so I bet it's a stupid fucking mistake -- but I'll allow myself since this is the first time I use this thing. I attached the code to the message. Any tips?...

Tiptap Rich Text Editor data validation (alternatives welcome)

Hi. I'm using TipTap to provide a rich text editor for my app. Has anyone ever validated the data going into / out of tiptap? I'm not sure how to write a zod parser for it or if theres a more reasonable way to check the data.

NextAuth login with Youtube scopes

I've been trying to use nextauth to have the user consent to some scopes for the youtube Data API v3. Everything works fine but Google returns error. ``` GoogleProvider({ clientId: env.GOOGLE_CLIENT_ID,...

Hosting shop on vercel

Hey guys, I have a quick question. My girlfriend wants a website where she can sell her art pieces and I want to make a web for her. Is it possible to host it on vercel?

How to type object like this as props

Heyy I play a little with trpc and optimistic updates and I wonder how can I type object like this when I pass it as props. ```js const addTodo = api.todos.createTodo.useMutation({ async onMutate(newTodo) { // Cancel outgoing fetches (so they don't overwrite our optimistic update)...

Does Prisma has Multi-tenant feature? 👀

If you could suggest any alternative solution that will be helpful too!

Vercel Timeouts 😶🌫 What can I do if I need longer server functions?

I have some tRPC mutations that take over 10 seconds and closer to 1 minute to complete. Currently they are getting timed out by Vercel. I can see that I can buy a Team plan but that isn't favorable. What are your recommendations? How do you deal with this?...