Authorize
Register User
When user is registered, the user’s uuid will be storied in the storage. This will allow to identify the user in the future. Please note that you also need to store it in the database in case the user clears the storage.Authorize existing user
You can use stored users uuid to authorize the user.Authorized User
You can get the current authorized user by using theuser
property.
useUser
hook returns the current user object, which includes the name and email properties. If no user is currently logged in, the hook will return null.
You can use the useUser
hook anywhere within a component tree that is wrapped in the UseawardsProvider. If there is no UseawardsProvider in the tree, the useUser hook will throw an error.