summaryrefslogtreecommitdiff
path: root/src/common/components/Authenticated
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/components/Authenticated')
-rw-r--r--src/common/components/Authenticated/index.tsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/components/Authenticated/index.tsx b/src/common/components/Authenticated/index.tsx
index cf7086e..3957a8d 100644
--- a/src/common/components/Authenticated/index.tsx
+++ b/src/common/components/Authenticated/index.tsx
@@ -1,10 +1,9 @@
-import { cookies } from 'next/headers'
+import getServerCredential from '@/common/libs/getServerCredential'
import { redirect } from 'next/navigation'
import React from 'react'
const Authenticated = ({ children }: { children: React.ReactNode }) => {
- const credentialStr = cookies().get('credential')?.value
- const credential: Credential | null = credentialStr ? JSON.parse(credentialStr) : null
+ const credential = getServerCredential()
if (!credential) redirect('/login')