feat: add environment configuration and implement cookie handling for user authentication

This commit is contained in:
Ardeman
2025-02-27 19:37:31 +08:00
parent 9386b8dd69
commit f9d861f24d
15 changed files with 213 additions and 30 deletions
+16
View File
@@ -0,0 +1,16 @@
import { adminTokenCookieConfig, userTokenCookieConfig } from './cookie.server'
export const handleCookie = async (request: Request) => {
const headers = request.headers
const userToken = (await userTokenCookieConfig.parse(
headers.get('Cookie'),
)) as string
const adminToken = (await adminTokenCookieConfig.parse(
headers.get('Cookie'),
)) as string
return {
userToken,
adminToken,
}
}