fix: analytics and deprecated warning

This commit is contained in:
2026-01-21 13:58:34 -05:00
parent 7b60494d6d
commit 955c856a85
9 changed files with 95 additions and 55 deletions

View File

@@ -1,6 +1,5 @@
import type { APIEvent } from "@solidjs/start/server";
import { appRouter } from "~/server/api/root";
import { createTRPCContext } from "~/server/api/utils";
import { createServerCaller } from "~/server/api/root";
export async function GET(event: APIEvent) {
const url = new URL(event.request.url);
@@ -31,8 +30,7 @@ export async function GET(event: APIEvent) {
try {
console.log("[GitHub OAuth Callback] Creating tRPC caller...");
const ctx = await createTRPCContext(event);
const caller = appRouter.createCaller(ctx);
const caller = await createServerCaller(event);
console.log("[GitHub OAuth Callback] Calling githubCallback procedure...");
const result = await caller.auth.githubCallback({ code });

View File

@@ -1,6 +1,5 @@
import type { APIEvent } from "@solidjs/start/server";
import { appRouter } from "~/server/api/root";
import { createTRPCContext } from "~/server/api/utils";
import { createServerCaller } from "~/server/api/root";
export async function GET(event: APIEvent) {
const url = new URL(event.request.url);
@@ -31,8 +30,7 @@ export async function GET(event: APIEvent) {
try {
console.log("[Google OAuth Callback] Creating tRPC caller...");
const ctx = await createTRPCContext(event);
const caller = appRouter.createCaller(ctx);
const caller = await createServerCaller(event);
console.log("[Google OAuth Callback] Calling googleCallback procedure...");
const result = await caller.auth.googleCallback({ code });

View File

@@ -1,6 +1,5 @@
import type { APIEvent } from "@solidjs/start/server";
import { appRouter } from "~/server/api/root";
import { createTRPCContext } from "~/server/api/utils";
import { createServerCaller } from "~/server/api/root";
export async function GET(event: APIEvent) {
const url = new URL(event.request.url);
@@ -27,8 +26,7 @@ export async function GET(event: APIEvent) {
try {
console.log("[Email Login Callback] Creating tRPC caller...");
// Create tRPC caller to invoke the emailLogin procedure
const ctx = await createTRPCContext(event);
const caller = appRouter.createCaller(ctx);
const caller = await createServerCaller(event);
console.log("[Email Login Callback] Calling emailLogin procedure...");
// Call the email login handler - rememberMe will be read from JWT payload

View File

@@ -1,6 +1,5 @@
import type { APIEvent } from "@solidjs/start/server";
import { appRouter } from "~/server/api/root";
import { createTRPCContext } from "~/server/api/utils";
import { createServerCaller } from "~/server/api/root";
export async function GET(event: APIEvent) {
const url = new URL(event.request.url);
@@ -57,20 +56,19 @@ export async function GET(event: APIEvent) {
`,
{
status: 400,
headers: { "Content-Type": "text/html" },
headers: { "Content-Type": "text/html" }
}
);
}
try {
// Create tRPC caller to invoke the emailVerification procedure
const ctx = await createTRPCContext(event);
const caller = appRouter.createCaller(ctx);
const caller = await createServerCaller(event);
// Call the email verification handler
const result = await caller.auth.emailVerification({
email,
token,
token
});
if (result.success) {
@@ -129,7 +127,7 @@ export async function GET(event: APIEvent) {
`,
{
status: 200,
headers: { "Content-Type": "text/html" },
headers: { "Content-Type": "text/html" }
}
);
} else {
@@ -139,8 +137,10 @@ export async function GET(event: APIEvent) {
console.error("Email verification callback error:", error);
// Check if it's a token expiration error
const errorMessage = error instanceof Error ? error.message : "server_error";
const isTokenError = errorMessage.includes("expired") || errorMessage.includes("invalid");
const errorMessage =
error instanceof Error ? error.message : "server_error";
const isTokenError =
errorMessage.includes("expired") || errorMessage.includes("invalid");
return new Response(
`
@@ -192,7 +192,7 @@ export async function GET(event: APIEvent) {
`,
{
status: 400,
headers: { "Content-Type": "text/html" },
headers: { "Content-Type": "text/html" }
}
);
}