mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
refactor(console): remove user claim temp workaround (#2518)
This commit is contained in:
parent
3f41278a24
commit
56d01abe4d
1 changed files with 2 additions and 7 deletions
|
@ -26,11 +26,7 @@ const UserInfo = () => {
|
||||||
(async () => {
|
(async () => {
|
||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
const userInfo = await getIdTokenClaims();
|
const userInfo = await getIdTokenClaims();
|
||||||
// TODO: revert after SDK updated
|
setUser(userInfo ?? { sub: '', username: 'N/A' }); // Provide a fallback to avoid infinite loading state
|
||||||
setUser({
|
|
||||||
picture: undefined,
|
|
||||||
...(userInfo ?? { sub: '', username: 'N/A' }),
|
|
||||||
}); // Provide a fallback to avoid infinite loading state
|
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}, [isAuthenticated, getIdTokenClaims]);
|
}, [isAuthenticated, getIdTokenClaims]);
|
||||||
|
@ -55,8 +51,7 @@ const UserInfo = () => {
|
||||||
setShowDropdown(true);
|
setShowDropdown(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* TODO: revert after SDK updated */}
|
<img src={picture ?? generateAvatarPlaceHolderById(id)} alt="avatar" />
|
||||||
<img src={picture ? String(picture) : generateAvatarPlaceHolderById(id)} alt="avatar" />
|
|
||||||
<div className={styles.wrapper}>
|
<div className={styles.wrapper}>
|
||||||
<div className={styles.name}>{username}</div>
|
<div className={styles.name}>{username}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue