Skip to content

Commit

Permalink
Slug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
talhathmd committed Oct 6, 2024
1 parent 119f70f commit 159be80
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/app/api/auth/[slug]/route.ts
Original file line number Diff line number Diff line change
@@ -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
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
];
}

0 comments on commit 159be80

Please sign in to comment.