0
Fork 0
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:
Charles Zhao 2022-11-24 11:18:41 +08:00 committed by GitHub
parent 3f41278a24
commit 56d01abe4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,11 +26,7 @@ const UserInfo = () => {
(async () => {
if (isAuthenticated) {
const userInfo = await getIdTokenClaims();
// TODO: revert after SDK updated
setUser({
picture: undefined,
...(userInfo ?? { sub: '', username: 'N/A' }),
}); // Provide a fallback to avoid infinite loading state
setUser(userInfo ?? { sub: '', username: 'N/A' }); // Provide a fallback to avoid infinite loading state
}
})();
}, [isAuthenticated, getIdTokenClaims]);
@ -55,8 +51,7 @@ const UserInfo = () => {
setShowDropdown(true);
}}
>
{/* TODO: revert after SDK updated */}
<img src={picture ? String(picture) : generateAvatarPlaceHolderById(id)} alt="avatar" />
<img src={picture ?? generateAvatarPlaceHolderById(id)} alt="avatar" />
<div className={styles.wrapper}>
<div className={styles.name}>{username}</div>
</div>