summaryrefslogtreecommitdiff
path: root/src/common/stores/useAuthStore.ts
blob: b88cf0b6de7b297a9ac3314d66c1966867c8f2aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { create } from "zustand";
import { Credential } from "../types/auth";

type State = {
  credentials: Credential | null | undefined;
};

type Action = {
  setCredentials: (credentials: Credential | null) => void;
};

export const useAuthStore = create<State & Action>((set) => ({
  credentials: null,
  setCredentials: (credentials) => set({ credentials }),
}));