After a user logs in using FCL (Flow Client Library), you can store the current user's data by using the useCurrentUser hook. This hook allows you to get the user data when a user is signed in.
Here is a sample code snippet:
import * as fcl from '@onflow/fcl'
import useCurrentUser from '../hooks/useCurrentUser'
export default function Navbar() {
const user = useCurrentUser()
return (
<div className={navbarStyles.navbar}>
{!user.loggedIn &&
<button onClick={fcl.authenticate} className={elementStyles.button}>
Log In With Wallet
</button>
}
{user.loggedIn &&
<>
<div className={navbarStyles.address}>{ user?.addr }</div>
<button onClick={fcl.unauthenticate} className={elementStyles.button}>
Log Out
</button>
</>
}
</div>
)
}
In this example, useCurrentUser() is used to get the current user's data. When the user is signed in, the user.loggedIn flag is true. The user's wallet address can be accessed with user.addr.
For more information read out Flow App Quickstart.