From 022e927b77f4d8dd8711645e314b97628a2c55f4 Mon Sep 17 00:00:00 2001 From: Nidboj132 Date: Sat, 6 May 2023 17:59:09 +0200 Subject: login test --- frontend/src/components/login.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'frontend/src/components/login.js') diff --git a/frontend/src/components/login.js b/frontend/src/components/login.js index 558bc8f..8dea383 100644 --- a/frontend/src/components/login.js +++ b/frontend/src/components/login.js @@ -1,5 +1,6 @@ import React from 'react'; import { Link } from "react-router-dom"; +import Cookies from 'js-cookie'; import "./login.css"; import img1 from "../imgs/login.png" @@ -13,6 +14,7 @@ function login() { window.location.href="https://lp.ardapektezol.com/api/v1/login" } function logout() { + Cookies.remove('token') setToken(null) window.location.href="/" } @@ -36,7 +38,7 @@ React.useEffect(() => { }}) .then(r => r.json()) .then(d => {setProfile(d);console.log(d)}) - }, []); + }, [token]); return ( -- cgit v1.2.3