removed excess comments
This commit is contained in:
@@ -22,11 +22,9 @@ export async function GET(event: APIEvent) {
|
||||
}
|
||||
|
||||
try {
|
||||
// Create tRPC caller to invoke the githubCallback procedure
|
||||
const ctx = await createTRPCContext(event);
|
||||
const caller = appRouter.createCaller(ctx);
|
||||
|
||||
// Call the GitHub callback handler
|
||||
const result = await caller.auth.githubCallback({ code });
|
||||
|
||||
if (result.success) {
|
||||
|
||||
@@ -22,11 +22,9 @@ export async function GET(event: APIEvent) {
|
||||
}
|
||||
|
||||
try {
|
||||
// Create tRPC caller to invoke the googleCallback procedure
|
||||
const ctx = await createTRPCContext(event);
|
||||
const caller = appRouter.createCaller(ctx);
|
||||
|
||||
// Call the Google callback handler
|
||||
const result = await caller.auth.googleCallback({ code });
|
||||
|
||||
if (result.success) {
|
||||
|
||||
@@ -5,14 +5,13 @@ export async function POST() {
|
||||
"use server";
|
||||
const event = getEvent()!;
|
||||
|
||||
// Clear the userIDToken cookie (the actual session cookie)
|
||||
setCookie(event, "userIDToken", "", {
|
||||
path: "/",
|
||||
httpOnly: true,
|
||||
secure: true, // Always enforce secure cookies
|
||||
secure: true,
|
||||
sameSite: "lax",
|
||||
maxAge: 0, // Expire immediately
|
||||
expires: new Date(0) // Set expiry to past date
|
||||
maxAge: 0,
|
||||
expires: new Date(0)
|
||||
});
|
||||
|
||||
return new Response(null, {
|
||||
|
||||
@@ -4,16 +4,11 @@ import { appRouter } from "~/server/api/root";
|
||||
import { createTRPCContext } from "~/server/api/utils";
|
||||
|
||||
const handler = (event: APIEvent) => {
|
||||
// adapts tRPC to fetch API style requests
|
||||
return fetchRequestHandler({
|
||||
// the endpoint handling the requests
|
||||
endpoint: "/api/trpc",
|
||||
// the request object
|
||||
req: event.request,
|
||||
// the router for handling the requests
|
||||
router: appRouter,
|
||||
// any arbitrary data that should be available to all actions
|
||||
createContext: () => createTRPCContext(event),
|
||||
createContext: () => createTRPCContext(event)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user