diff options
Diffstat (limited to 'src/common/components/Authenticated/index.tsx')
| -rw-r--r-- | src/common/components/Authenticated/index.tsx | 5 |
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') |
