diff options
Diffstat (limited to 'frontend/src/components/login.js')
| -rw-r--r-- | frontend/src/components/login.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/frontend/src/components/login.js b/frontend/src/components/login.js index 2b735cb..f86ad44 100644 --- a/frontend/src/components/login.js +++ b/frontend/src/components/login.js | |||
| @@ -23,7 +23,11 @@ const [isLoggedIn, setIsLoggedIn] = React.useState(false); | |||
| 23 | React.useEffect(() => { | 23 | React.useEffect(() => { |
| 24 | fetch(`https://lp.ardapektezol.com/api/v1/token`) | 24 | fetch(`https://lp.ardapektezol.com/api/v1/token`) |
| 25 | .then(r => r.json()) | 25 | .then(r => r.json()) |
| 26 | .then(d => setToken(d.data.token)) | 26 | .then(d => { |
| 27 | if (d.data != null) { | ||
| 28 | setToken(d.data.token) | ||
| 29 | } | ||
| 30 | }) | ||
| 27 | }, []); | 31 | }, []); |
| 28 | 32 | ||
| 29 | 33 | ||