mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-08 05:56:38 +00:00
17 lines
341 B
TypeScript
17 lines
341 B
TypeScript
import { GetUserResponse } from "@server/routers/user";
|
|
import { verifySession } from "./verifySession";
|
|
|
|
export async function isValidUser(): Promise<GetUserResponse | null> {
|
|
const user = await verifySession();
|
|
|
|
if (!user) {
|
|
return null;
|
|
}
|
|
|
|
if (!user.emailVerified) {
|
|
return null;
|
|
}
|
|
|
|
return user;
|
|
}
|