remove test endpoint
This commit is contained in:
@@ -185,10 +185,6 @@ const loginSchema = z.object({
|
||||
password: z.string().min(1)
|
||||
});
|
||||
|
||||
const testTokenSchema = z.object({
|
||||
userId: z.string().min(1)
|
||||
});
|
||||
|
||||
export const cairnDbRouter = createTRPCRouter({
|
||||
health: cairnProcedure.query(async () => {
|
||||
try {
|
||||
@@ -239,15 +235,39 @@ export const cairnDbRouter = createTRPCRouter({
|
||||
});
|
||||
await conn.execute({
|
||||
sql: "INSERT INTO authProviders (id, userId, provider, providerUserId, email, displayName, avatarUrl) VALUES (?, ?, ?, ?, ?, ?, ?)",
|
||||
args: [crypto.randomUUID(), userId, "email", null, input.email, null, null]
|
||||
args: [
|
||||
crypto.randomUUID(),
|
||||
userId,
|
||||
"email",
|
||||
null,
|
||||
input.email,
|
||||
null,
|
||||
null
|
||||
]
|
||||
});
|
||||
await conn.execute({
|
||||
sql: "INSERT INTO authProviders (id, userId, provider, providerUserId, email, displayName, avatarUrl) VALUES (?, ?, ?, ?, ?, ?, ?)",
|
||||
args: [crypto.randomUUID(), userId, "password", passwordHash, input.email, null, null]
|
||||
args: [
|
||||
crypto.randomUUID(),
|
||||
userId,
|
||||
"password",
|
||||
passwordHash,
|
||||
input.email,
|
||||
null,
|
||||
null
|
||||
]
|
||||
});
|
||||
await conn.execute({
|
||||
sql: "INSERT INTO workoutPlans (id, userId, name, category, difficulty, type, isPublic) VALUES (?, ?, ?, ?, ?, ?, ?)",
|
||||
args: [crypto.randomUUID(), userId, "Getting Started", "strength", "beginner", "strength", 0]
|
||||
args: [
|
||||
crypto.randomUUID(),
|
||||
userId,
|
||||
"Getting Started",
|
||||
"strength",
|
||||
"beginner",
|
||||
"strength",
|
||||
0
|
||||
]
|
||||
});
|
||||
|
||||
const token = await signCairnToken(userId);
|
||||
@@ -264,9 +284,7 @@ export const cairnDbRouter = createTRPCRouter({
|
||||
}
|
||||
}),
|
||||
|
||||
login: publicProcedure
|
||||
.input(loginSchema)
|
||||
.mutation(async ({ input }) => {
|
||||
login: publicProcedure.input(loginSchema).mutation(async ({ input }) => {
|
||||
try {
|
||||
const conn = CairnConnectionFactory();
|
||||
const result = await conn.execute({
|
||||
@@ -334,21 +352,6 @@ export const cairnDbRouter = createTRPCRouter({
|
||||
}
|
||||
}),
|
||||
|
||||
createTestToken: publicProcedure
|
||||
.input(testTokenSchema)
|
||||
.mutation(async ({ input }) => {
|
||||
try {
|
||||
const token = await signCairnToken(input.userId);
|
||||
return { success: true, token, userId: input.userId };
|
||||
} catch (error) {
|
||||
console.error("Failed to create Cairn test token:", error);
|
||||
throw new TRPCError({
|
||||
code: "INTERNAL_SERVER_ERROR",
|
||||
message: "Failed to create test token"
|
||||
});
|
||||
}
|
||||
}),
|
||||
|
||||
getUsers: cairnProcedure
|
||||
.input(paginatedQuerySchema)
|
||||
.query(async ({ input, ctx }) => {
|
||||
|
||||
Reference in New Issue
Block a user