diff options
Diffstat (limited to 'frontend/src/components/login.js')
| -rw-r--r-- | frontend/src/components/login.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/frontend/src/components/login.js b/frontend/src/components/login.js index 6cb196b..a4a3397 100644 --- a/frontend/src/components/login.js +++ b/frontend/src/components/login.js | |||
| @@ -35,10 +35,13 @@ React.useEffect(() => { | |||
| 35 | }}) | 35 | }}) |
| 36 | .then(r => r.json()) | 36 | .then(r => r.json()) |
| 37 | .then(d => { | 37 | .then(d => { |
| 38 | console.log("data:", d); | ||
| 38 | setProfile(d.data); | 39 | setProfile(d.data); |
| 39 | setIsLoggedIn(true) | 40 | console.log("profile:", profile); |
| 40 | console.log(d,profile) | 41 | }) |
| 41 | }) | 42 | .catch(error => { |
| 43 | console.log("error:", error); | ||
| 44 | }); | ||
| 42 | }, [token]); | 45 | }, [token]); |
| 43 | 46 | ||
| 44 | 47 | ||
| @@ -47,10 +50,10 @@ return ( | |||
| 47 | {isLoggedIn ? ( | 50 | {isLoggedIn ? ( |
| 48 | <Link to="/profile" tabIndex={-1} className='login'> | 51 | <Link to="/profile" tabIndex={-1} className='login'> |
| 49 | <button> | 52 | <button> |
| 50 | <img src={profile.avatar_link} alt="" /> | 53 | {/* <img src={profile.avatar_link} alt="" /> */} |
| 51 | {/* <img src={img2} alt="" /> */} | 54 | <img src={img2} alt="" /> |
| 52 | <span>{profile.user_name}</span> | 55 | {/* <span>{profile.user_name}</span> */} |
| 53 | {/* <span>Username</span> */} | 56 | <span>Username</span> |
| 54 | </button> | 57 | </button> |
| 55 | <button onClick={logout}><img src={img3} alt="" /><span></span></button> | 58 | <button onClick={logout}><img src={img3} alt="" /><span></span></button> |
| 56 | </Link> | 59 | </Link> |