mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-22 20:01:36 +00:00
27 lines
618 B
TypeScript
27 lines
618 B
TypeScript
import { cookies } from "next/headers";
|
|
import axios from "axios";
|
|
import { ValidatePathResponse } from "types/googleapis";
|
|
|
|
async function _validatePath(path: string) {
|
|
const { data } = await axios.get<ValidatePathResponse>(
|
|
`/api/validate-path?path=${path}`,
|
|
);
|
|
return data;
|
|
}
|
|
|
|
type Props = {
|
|
params: {
|
|
path: string[];
|
|
};
|
|
};
|
|
async function ListIdPage({ params }: Props) {
|
|
const validatePath = await _validatePath(
|
|
params.path.join("/"),
|
|
);
|
|
const c = cookies();
|
|
const token = c.has("token") ? c.get("token")?.name : "";
|
|
return <div>lorem - {token}</div>;
|
|
}
|
|
|
|
export default ListIdPage;
|