diff options
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/src/components/login.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/src/components/login.js b/frontend/src/components/login.js index 266c147..7bff5f0 100644 --- a/frontend/src/components/login.js +++ b/frontend/src/components/login.js | |||
| @@ -13,11 +13,11 @@ function login() { | |||
| 13 | window.location.href="https://lp.ardapektezol.com/api/v1/login" | 13 | window.location.href="https://lp.ardapektezol.com/api/v1/login" |
| 14 | } | 14 | } |
| 15 | function logout() { | 15 | function logout() { |
| 16 | fetch(`/api/v1/token`,{'method':'DELETE'}) | ||
| 17 | setIsLoggedIn(false) | 16 | setIsLoggedIn(false) |
| 18 | setProfile(null) | 17 | setProfile(null) |
| 19 | setToken(null) | 18 | setToken(null) |
| 20 | setTimeout(() => {window.location.href="/"}, 300); | 19 | fetch(`/api/v1/token`,{'method':'DELETE'}) |
| 20 | .then(r=>window.location.href="/") | ||
| 21 | } | 21 | } |
| 22 | const [token, setToken] = React.useState(null); | 22 | const [token, setToken] = React.useState(null); |
| 23 | const [isLoggedIn, setIsLoggedIn] = React.useState(false); | 23 | const [isLoggedIn, setIsLoggedIn] = React.useState(false); |