Type Alias: GetUserData()
Get current user's data or if not exists current session. Use this method to get information about currently logged in user. This is useful for reading current state of authentication or accessing current user details.
Usage
mimeeqAuth.authorization
.getUserData()
.then((user) => {
if (user) {
// logged in
console.log(user);
} else {
// logged out
}
})
.catch((err) => {
console.error(err);
});
Returns
Promise
<Nullable
<UserData
| AuthError
>>
A promise resolves to user data or session object if success