shu
shu
Explore posts from servers
TTCTheo's Typesafe Cult
Created by shu on 5/20/2023 in #questions
Error when deploying T3-Turbo on vercel (using yarn)
5 replies
TTCTheo's Typesafe Cult
Created by shu on 5/20/2023 in #questions
Error when deploying T3-Turbo on vercel (using yarn)
Made pnpm repo as well and same issue
5 replies
TTCTheo's Typesafe Cult
Created by shu on 5/20/2023 in #questions
Error when deploying T3-Turbo on vercel (using yarn)
5 replies
TtRPC
Created by shu on 5/19/2023 in #❓-help
tRPC type error on turborepo
I'm a bit of a noobie so yeah 😅 any help would be greatly appreciated
6 replies
TtRPC
Created by shu on 5/19/2023 in #❓-help
tRPC type error on turborepo
6 replies
TtRPC
Created by shu on 5/19/2023 in #❓-help
tRPC type error on turborepo
types work on expo but not on nextjs
6 replies
TtRPC
Created by shu on 5/19/2023 in #❓-help
tRPC type error on turborepo
File structure is apps/(expo and next), packages/(api)
6 replies
TtRPC
Created by shu on 5/19/2023 in #❓-help
tRPC type error on turborepo
All versions are the same (10.20.0) and im using pnpm
6 replies
TtRPC
Created by MonkeyStruct on 4/25/2023 in #❓-help
createTRPCNext type error
Hi, im having the same error expect my versions are all 10.20.0
6 replies
TTCTheo's Typesafe Cult
Created by shu on 5/18/2023 in #questions
tRPC losing types on t3-turbo
11 replies
TTCTheo's Typesafe Cult
Created by shu on 5/18/2023 in #questions
tRPC losing types on t3-turbo
Just checked it out, both workspace and global ts version is the same (5.0.4), tried using the workspace version and restarting tsserver and vscode but its still the same...
11 replies
TTCTheo's Typesafe Cult
Created by shu on 5/18/2023 in #questions
tRPC losing types on t3-turbo
I did get a notification from vscode asking about the typescript version, that might be something...i tried restarting the TS server multiple times, and even restarting vscode altogether did not change anything
11 replies
TTCTheo's Typesafe Cult
Created by shu on 5/18/2023 in #questions
tRPC losing types on t3-turbo
auth router
import bcrypt from "bcryptjs";
import { z } from "zod";

import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc";

export const authRouter = createTRPCRouter({
getSession: publicProcedure.query(({ ctx }) => {
return ctx.session;
}),

register: publicProcedure.input(z.object({ email: z.string(), password: z.string() })).mutation(async ({ ctx, input }) => {
const user = await ctx.prisma.user.findUnique({ where: { email: input.email } });

if (user) {
return null;
}

const salt = bcrypt.genSaltSync(10);
const hashedPassword = bcrypt.hashSync(input.password, salt);

return ctx.prisma.user.create({ data: { email: input.email, password: hashedPassword } });
}),

authorize: publicProcedure.input(z.object({ email: z.string(), password: z.string() })).mutation(async ({ ctx, input }) => {
const user: { email: string, password: string} | null = await ctx.prisma.user.findUnique({ where: { email: input.email } });

if (!user) {
return null;
}

const auth = bcrypt.compareSync(input.password, user.password);

if (auth) {
return user;
} else {
return null;
}
}),
});
import bcrypt from "bcryptjs";
import { z } from "zod";

import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc";

export const authRouter = createTRPCRouter({
getSession: publicProcedure.query(({ ctx }) => {
return ctx.session;
}),

register: publicProcedure.input(z.object({ email: z.string(), password: z.string() })).mutation(async ({ ctx, input }) => {
const user = await ctx.prisma.user.findUnique({ where: { email: input.email } });

if (user) {
return null;
}

const salt = bcrypt.genSaltSync(10);
const hashedPassword = bcrypt.hashSync(input.password, salt);

return ctx.prisma.user.create({ data: { email: input.email, password: hashedPassword } });
}),

authorize: publicProcedure.input(z.object({ email: z.string(), password: z.string() })).mutation(async ({ ctx, input }) => {
const user: { email: string, password: string} | null = await ctx.prisma.user.findUnique({ where: { email: input.email } });

if (!user) {
return null;
}

const auth = bcrypt.compareSync(input.password, user.password);

if (auth) {
return user;
} else {
return null;
}
}),
});
11 replies
TTCTheo's Typesafe Cult
Created by shu on 5/18/2023 in #questions
tRPC losing types on t3-turbo
11 replies
TTCTheo's Typesafe Cult
Created by shu on 5/18/2023 in #questions
tRPC losing types on t3-turbo
in nextjs
11 replies
TTCTheo's Typesafe Cult
Created by shu on 5/18/2023 in #questions
tRPC losing types on t3-turbo
11 replies
TTCTheo's Typesafe Cult
Created by shu on 5/18/2023 in #questions
tRPC losing types on t3-turbo
in expo
11 replies
TTCTheo's Typesafe Cult
Created by shu on 4/30/2023 in #questions
why do i keep getting errors like errors like this on t3 turbo when trying to install packages
sorry for the late reply but yes
3 replies
TTCTheo's Typesafe Cult
Created by shu on 4/8/2023 in #questions
Expo interactive mode on turborepo
Ohh thanks for the help, thanks for the template as well, clerk is cool :)
12 replies