mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-11 15:36:38 +00:00
migrate to next 15 and react 19
This commit is contained in:
@@ -2,13 +2,13 @@ import { internal } from "@app/api";
|
||||
import { authCookieHeader } from "@app/api/cookies";
|
||||
import { GetUserResponse } from "@server/routers/user";
|
||||
import { AxiosResponse } from "axios";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export async function verifySession(): Promise<GetUserResponse | null> {
|
||||
const sessionId = cookies().get("session")?.value ?? null;
|
||||
|
||||
try {
|
||||
const res = await internal.get<AxiosResponse<GetUserResponse>>("/user", authCookieHeader());
|
||||
const res = await internal.get<AxiosResponse<GetUserResponse>>(
|
||||
"/user",
|
||||
await authCookieHeader()
|
||||
);
|
||||
|
||||
return res.data.data;
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user