chore: Address PR comments 4

Signed-off-by: Carlos Esteban Lopez <lcarlosesteb@vmware.com>
This commit is contained in:
Carlos Esteban Lopez
2023-11-22 18:00:31 -05:00
parent b3552bbfb5
commit 3bd14fc7df
@@ -79,14 +79,20 @@ export const vmwareCloudAuthenticator = createOAuthAuthenticator<
);
}
if (identity.context_name !== input.fullProfile.organizationId) {
// These claims were checked for presence & type
const { email, given_name, family_name, context_name } = identity as Record<
string,
string
>;
if (context_name !== input.fullProfile.organizationId) {
throw new Error(`ID token organizationId mismatch`);
}
return {
profile: {
displayName: `${identity.given_name} ${identity.family_name}`,
email: identity.email as string,
displayName: `${given_name} ${family_name}`,
email,
},
};
},