Skip to content

Commit

Permalink
chore(passport): Apple hidden email not reachable by third-parties (#…
Browse files Browse the repository at this point in the history
…2793)

* chore(passport): Apple hidden email not reachable by third-parties
  • Loading branch information
Cosmin-Parvulescu authored Dec 20, 2023
1 parent 292a870 commit e2ccdfe
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/design-system/src/atoms/info/Info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function Info({
warning = false,
}: {
name: string
description: string
description: string | JSX.Element
placement?: 'top' | 'bottom' | 'left' | 'right'
editable?: boolean
warning?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ type AuthorizationProps = {
radius?: string
}

const isAppleEmail = (email: string | undefined) => {
if (!email) return false
return ['icloud.com', 'privaterelay.appleid.com'].some((tld) =>
email.endsWith(`@${tld}`)
)
}

//eslint-disable-next-line react/display-name
export default ({
userProfile,
Expand Down Expand Up @@ -180,10 +187,30 @@ export default ({
warning={true}
/>
) : (
<Info
name={scopeMeta.scopes[scope].name}
description={scopeMeta.scopes[scope].description}
/>
<>
{scope === 'email' &&
isAppleEmail(selectedEmail?.title) ? (
<Info
name={scopeMeta.scopes[scope].name}
description={
<span>
If you have enabled Apple's Hide My Email the
application being authorised will not be able to
send emails to it, due to restrictions on
Apple's services. <br /> <br /> Consider using
Rollup's email masking instead by toggling it in
the Email dropdown.
</span>
}
warning={true}
/>
) : (
<Info
name={scopeMeta.scopes[scope].name}
description={scopeMeta.scopes[scope].description}
/>
)}
</>
)}

<div
Expand Down

0 comments on commit e2ccdfe

Please sign in to comment.