diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-17 15:14:46 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-17 15:14:46 +0700 |
| commit | e101de1a0bc1ab08c2bed1fe2bed0ec3ad45a442 (patch) | |
| tree | 14834b231116a1d8060b4c02f664fd23850fa99a /src/common/libs/getClientCredential.ts | |
| parent | 05ef2c3712192df547587b7d02416f6be0419e1f (diff) | |
Create get credential lib and result constant
Diffstat (limited to 'src/common/libs/getClientCredential.ts')
| -rw-r--r-- | src/common/libs/getClientCredential.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/libs/getClientCredential.ts b/src/common/libs/getClientCredential.ts new file mode 100644 index 0000000..fc0bd76 --- /dev/null +++ b/src/common/libs/getClientCredential.ts @@ -0,0 +1,9 @@ +"use client"; +import { getCookie } from "cookies-next"; +import { Credential } from "../types/auth"; + +export default function getClientCredential(): Credential | null { + const credentialStr = getCookie("credential"); + + return credentialStr ? JSON.parse(credentialStr) : null; +} |
