changed project struture.
Also addded a functional JWT token service. Also added user react frontend
This commit is contained in:
12
frontend_admin/src/utils/functions.ts
Normal file
12
frontend_admin/src/utils/functions.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
export const greeting = () => {
|
||||
return Cookies.get("name") ?? "Login";
|
||||
};
|
||||
|
||||
export const logout = () => {
|
||||
Cookies.remove("name");
|
||||
Cookies.remove("token");
|
||||
localStorage.removeItem("users");
|
||||
window.location.reload();
|
||||
};
|
Reference in New Issue
Block a user