From 159be8053739d3bfd2bf9c2ca427340f56d8c6ee Mon Sep 17 00:00:00 2001 From: Talha Tahmid Date: Sun, 6 Oct 2024 10:26:55 -0500 Subject: [PATCH] Slug fixing --- src/app/api/auth/[slug]/route.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/api/auth/[slug]/route.ts b/src/app/api/auth/[slug]/route.ts index cbd6bd1..72e5773 100644 --- a/src/app/api/auth/[slug]/route.ts +++ b/src/app/api/auth/[slug]/route.ts @@ -1,11 +1,19 @@ -import {getRouteHandlers} from "@propelauth/nextjs/server/app-router"; -import {NextRequest} from "next/server"; +// /api/auth/[slug].ts +import { getRouteHandlers } from "@propelauth/nextjs/server/app-router"; +import { NextRequest } from "next/server"; -// postLoginRedirectPathFn is optional, but if you want to redirect the user to a different page after login, you can do so here. const routeHandlers = getRouteHandlers({ postLoginRedirectPathFn: (req: NextRequest) => { - return "/welcome"; - } -}) -export const GET = routeHandlers.getRouteHandler -export const POST = routeHandlers.postRouteHandler \ No newline at end of file + return "/welcome"; // Redirect path after login + }, +}); + +export const GET = routeHandlers.getRouteHandler; +export const POST = routeHandlers.postRouteHandler; + +export async function generateStaticParams() { + return [ + { slug: 'example' }, // Example slug for static generation + // Add other slugs as needed + ]; +}