Merge pull request #1433 from spotify/rugvip/authid

auth-backend: leave it to the providers to figure out the backstage identity
This commit is contained in:
Patrik Oldsberg
2020-06-24 12:04:18 +02:00
committed by GitHub
8 changed files with 67 additions and 52 deletions
@@ -173,7 +173,7 @@ export type ProfileInfo = {
/**
* Email ID.
*/
email: string;
email?: string;
/**
* Display name that can be presented to the user.
@@ -34,14 +34,16 @@ export const UserProfile: FC<{ open: boolean; setOpen: Function }> = ({
}) => {
const ref = useRef<Element>(); // for scrolling down when collapse item opens
const classes = useStyles();
const profile = useApi(identityApiRef).getProfile();
const identityApi = useApi(identityApiRef);
const handleClick = () => {
setOpen(!open);
setTimeout(() => ref.current?.scrollIntoView({ behavior: 'smooth' }), 300);
};
const displayName = profile.displayName ?? profile.email;
const userId = identityApi.getUserId();
const profile = identityApi.getProfile();
const displayName = profile.displayName ?? userId;
const SignInAvatar = () => (
<Avatar src={profile.picture} className={classes.avatar}>
{displayName[0]}