CoastalCommitsPastes/client/lib/server/is-signed-in.ts

8 lines
253 B
TypeScript
Raw Normal View History

2022-11-10 02:11:36 -05:00
import { TOKEN_COOKIE_NAME, USER_COOKIE_NAME } from "@lib/constants"
import { cookies } from "next/headers"
export const isSignedIn = () => {
const cookieList = cookies()
2022-11-10 02:11:36 -05:00
return cookieList.has(TOKEN_COOKIE_NAME) && cookieList.has(USER_COOKIE_NAME)
}