|
@@ -1,7 +1,6 @@
|
|
|
"use client";
|
|
|
|
|
|
import React, { createContext, useContext, useState, useEffect } from "react";
|
|
|
-import Cookies from "js-cookie";
|
|
|
import { userInfo } from "@/lib/user";
|
|
|
|
|
|
export interface UserType {
|
|
@@ -24,8 +23,7 @@ export function CommonProvider({ children }: { children: React.ReactNode }) {
|
|
|
const [redirectAfterLogin, setRedirectAfterLogin] = useState<string>("/");
|
|
|
|
|
|
useEffect(() => {
|
|
|
- const ut = Cookies.get("ut");
|
|
|
- userInfo(ut).then(({ data: data }) => {
|
|
|
+ userInfo().then(({ data: data }) => {
|
|
|
if (data) {
|
|
|
const currentUser = {
|
|
|
id: data.id,
|