Closed tungstenian closed 1 month ago
In this case you'd want to define a route rather than a page since you aren't returning any elements.
If you rename that file to app/sign-out/route.ts
and use the following it should work as expected:
import { signOut } from "@workos-inc/authkit-nextjs";
export const GET = async () => {
await signOut();
};
In my nextjs project (specifically next-on-pages running on cloudflare), I am using the app router and have the following file at
app/sign-out/page.tsx
My intent is to be able to route people to
https://example.com/sign-out
to execute the functionality needed to clear their session.However, when visiting this page I get the following error.