fOfer
fOfer
Explore posts from servers
HHono
Created by fOfer on 7/5/2024 in #help
zValidator not coercing types correctly
No description
10 replies
RRailway
Created by fOfer on 8/29/2023 in #✋|help
PR environments are not being deployed for the project owner
6 replies
RRailway
Created by fOfer on 8/28/2023 in #✋|help
PR environments are not being deployed for the project owner
I have created a PR on my repo but I dont see any ephemeral deployment being created
62 replies
RRailway
Created by fOfer on 8/17/2023 in #✋|help
Turborepo Fastify cant import files from shared package
5 replies
TTCTheo's Typesafe Cult
Created by fOfer on 4/21/2023 in #questions
Using Prisma with fastify in create-t3-turbo
I am trying to setup a project based on create-t3-turbo so that I can share my prisma configuration between my nextjs app and fastify. I have managed to get the project working locally, but when i build and run the fastify server i get the following error:
fastify:start:
fastify:start: /Users/fofer/repos/catalyst/catalyst-t3-turbo/packages/db/index.ts:1
fastify:start: import { PrismaClient } from "@prisma/client";
fastify:start: ^^^^^^
fastify:start:
fastify:start: SyntaxError: Cannot use import statement outside a module
fastify:start: at internalCompileFunction (node:internal/vm:73:18)
fastify:start:
fastify:start: /Users/fofer/repos/catalyst/catalyst-t3-turbo/packages/db/index.ts:1
fastify:start: import { PrismaClient } from "@prisma/client";
fastify:start: ^^^^^^
fastify:start:
fastify:start: SyntaxError: Cannot use import statement outside a module
fastify:start: at internalCompileFunction (node:internal/vm:73:18)
8 replies
TTCTheo's Typesafe Cult
Created by fOfer on 12/12/2022 in #questions
Use nextauth with supabase email and password
I know this is not a recommended practice. But im trying to setup nextauth to work with supabase's
const { data, error } = await supabase.auth.signInWithPassword({
email: credentials?.email,
password: credentials?.password,
});
const { data, error } = await supabase.auth.signInWithPassword({
email: credentials?.email,
password: credentials?.password,
});
I have created the CredentialsProvider but once I submit the user and password, I get redirected propperly but the user's logged in session isn't persisted.
CredentialsProvider({
name: "Login",
credentials: {
email: { label: "email", type: "email", placeholder: "jsmith" },
password: { label: "Password", type: "password" },
},
async authorize(credentials, req) {
if (!credentials?.email || !credentials.password) return null;
const { data, error } = await supabase.auth.signInWithPassword({
email: credentials?.email,
password: credentials?.password,
});

if (error) throw Error(error.message);
if (!data.user) throw Error("No user found for this credentials");
return data.user;
},
}),
CredentialsProvider({
name: "Login",
credentials: {
email: { label: "email", type: "email", placeholder: "jsmith" },
password: { label: "Password", type: "password" },
},
async authorize(credentials, req) {
if (!credentials?.email || !credentials.password) return null;
const { data, error } = await supabase.auth.signInWithPassword({
email: credentials?.email,
password: credentials?.password,
});

if (error) throw Error(error.message);
if (!data.user) throw Error("No user found for this credentials");
return data.user;
},
}),
This is the provider im currently using, how can I extend the t3-stack in order to get this working?
2 replies