Skip to content

Commit

Permalink
[#206] add user data
Browse files Browse the repository at this point in the history
  • Loading branch information
ylem76 committed Aug 17, 2024
1 parent fdb24f5 commit 2a34546
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function UserProfile() {
try {
const response = await api.get('users/me')
setUser(response.data)
sessionStorage.setItem('user', response.data)
} catch (error) {
throw error
}
Expand All @@ -31,6 +32,8 @@ export default function UserProfile() {
router.push('/login')
setUser(null)
sessionStorage.clear()

document.cookie = `Authorization=; Max-Age=-99999999;`
}

useEffect(() => {
Expand Down

0 comments on commit 2a34546

Please sign in to comment.