diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-17 15:16:23 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-17 15:16:23 +0700 |
| commit | 07819844d5ef7e323fd956eacfedecb2f4f4bb80 (patch) | |
| tree | d83ba8c6ff7f47f568889ff8371ee9d9918ed166 /src/common/components | |
| parent | 10ce1ad59969576244ba786d7d17da2da3fe6f61 (diff) | |
Update result feature
Diffstat (limited to 'src/common/components')
| -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') |
