mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 01:06:39 +00:00
complete web device auth flow
This commit is contained in:
17
src/app/auth/login/device/page.tsx
Normal file
17
src/app/auth/login/device/page.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { verifySession } from "@app/lib/auth/verifySession";
|
||||
import { redirect } from "next/navigation";
|
||||
import DeviceLoginForm from "@/components/DeviceLoginForm";
|
||||
import { cache } from "react";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function DeviceLoginPage() {
|
||||
const getUser = cache(verifySession);
|
||||
const user = await getUser();
|
||||
|
||||
if (!user) {
|
||||
redirect("/auth/login?redirect=/auth/login/device");
|
||||
}
|
||||
|
||||
return <DeviceLoginForm userEmail={user?.email || ""} />;
|
||||
}
|
||||
Reference in New Issue
Block a user