Merge remote-tracking branch 'origin/feat_player'

This commit is contained in:
Kentai Radiquum 2024-07-29 21:39:37 +05:00
parent bb437fe7ca
commit 25e31a7799
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
62 changed files with 1508 additions and 701 deletions

View file

@ -1,13 +1,22 @@
"use client";
import { create } from "zustand";
import { getJWT, setJWT, removeJWT, fetchDataViaGet } from "@/app/api/utils";
import { getJWT, removeJWT, fetchDataViaGet } from "#/api/utils";
export const useUserStore = create((set, get) => ({
interface userState {
isAuth: boolean
user: Object | null
token: string | null
login: (user: Object, token: string) => void
logout: () => void
checkAuth: () => void
}
export const useUserStore = create<userState>((set, get) => ({
isAuth: false,
user: null,
token: null,
login: (user, token) => {
login: (user: Object, token: string) => {
set({ isAuth: true, user: user, token: token });
},
logout: () => {