251121_01_ENH : 로그인 및 인증 저장, api통신 시 자동으로 accessKey 붙게 조치
This commit is contained in:
22
src/store/jotai/auth.ts
Normal file
22
src/store/jotai/auth.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import { createLocalStorageAtom } from "@/store/jotai/utils";
|
||||
import { StorageKeys } from "@/store/storage/storage-keys";
|
||||
import type { LoginUser } from "@/types/auth";
|
||||
|
||||
export type AuthState = {
|
||||
user: LoginUser | null;
|
||||
seatNumber: string | null;
|
||||
};
|
||||
|
||||
const initialAuthState: AuthState = {
|
||||
user: null,
|
||||
seatNumber: null,
|
||||
};
|
||||
/**
|
||||
* AES 암호화된 localStorage 기반 로그인 상태 Atom
|
||||
*/
|
||||
export const authStateAtom = createLocalStorageAtom<AuthState>(
|
||||
StorageKeys.AuthState,
|
||||
initialAuthState,
|
||||
);
|
||||
Reference in New Issue
Block a user