auth-backend: clean up comments + fix getting email from profile

This commit is contained in:
Patrik Oldsberg
2020-06-24 10:24:06 +02:00
parent 005ca191a8
commit b709889fb5
2 changed files with 6 additions and 18 deletions
@@ -31,7 +31,7 @@ export const makeProfileInfo = (
const { displayName } = profile;
let email: string | undefined = undefined;
if (profile.emails) {
if (profile.emails && profile.emails.length > 0) {
const [firstEmail] = profile.emails;
email = firstEmail.value;
}
+5 -17
View File
@@ -238,8 +238,6 @@ export type OAuthPrivateInfo = {
refreshToken: string;
};
// {type: 'authorization_response', response: {...}}
/**
* Payload sent as a post message after the auth request is complete.
* If successful then has a valid payload with Auth information else contains an error.
@@ -271,22 +269,12 @@ export type RedirectInfo = {
status?: number;
};
/*
metadata:
name: john
spec:
profile:
email: john.doe@example.com
displayName: John Doe
picture: https://example.com/avatars/john.doe
identities:
- type: google
email: john.doe@gmail.com
/**
* Used to display login information to user, i.e. sidebar popup.
*
* It is also temporarily used as the profile of the signed-in user's Backstage
* identity, but we want to replace that with data from identity and/org catalog service
*/
// 1. Link to identity in catalog / within backstage
// 2. Display login information to user, i.e. sidebar popup
export type ProfileInfo = {
/**
* Email ID of the signed in user.