-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
448 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/packages/shared/lib/constants.ts b/packages/shared/lib/constants.ts | ||
index 63e73d801..0f88b15d8 100644 | ||
--- a/packages/shared/lib/constants.ts | ||
+++ b/packages/shared/lib/constants.ts | ||
@@ -49,7 +49,7 @@ export const APPS = { | ||
} as const; | ||
export const APPS_CONFIGURATION = { | ||
[APPS.PROTONACCOUNT]: { | ||
- publicPath: '', | ||
+ publicPath: '/account', | ||
subdomain: 'account', | ||
name: ACCOUNT_APP_NAME, | ||
bareName: 'Account', | ||
@@ -103,8 +103,8 @@ export const APPS_CONFIGURATION = { | ||
settingsSlug: 'calendar', | ||
}, | ||
[APPS.PROTONVPN_SETTINGS]: { | ||
- publicPath: '', | ||
- subdomain: '', | ||
+ publicPath: 'account/vpn', | ||
+ subdomain: 'account', | ||
name: VPN_APP_NAME, | ||
bareName: 'VPN', | ||
clientID: 'web-vpn-settings', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
diff --git a/packages/components/containers/index.ts b/packages/components/containers/index.ts | ||
index fd20d8e62..7c3e55c87 100644 | ||
--- a/packages/components/containers/index.ts | ||
+++ b/packages/components/containers/index.ts | ||
@@ -56,6 +56,5 @@ export * from './sessions'; | ||
export * from './support'; | ||
export * from './themes'; | ||
export * from './topBanners'; | ||
-export * from './verification'; | ||
export * from './v5WelcomeModal'; | ||
export * from './vpn'; | ||
|
||
diff --git a/packages/components/containers/verification/EmbeddedVerification.tsx b/packages/components/containers/verification/EmbeddedVerification.tsx | ||
deleted file mode 100644 | ||
index 242be9084..000000000 | ||
--- a/packages/components/containers/verification/EmbeddedVerification.tsx | ||
+++ /dev/null | ||
@@ -1,102 +0,0 @@ | ||
-import { useEffect, useMemo, useRef, useState } from 'react'; | ||
-import { localeCode } from '@proton/shared/lib/i18n'; | ||
-import { APPS } from '@proton/shared/lib/constants'; | ||
-import { HumanVerificationMethodType } from '@proton/shared/lib/interfaces'; | ||
-import { getAppUrlFromApiUrl, getAppUrlRelativeToOrigin, stringifySearchParams } from '@proton/shared/lib/helpers/url'; | ||
- | ||
-import { useConfig, useNotifications } from '../../hooks'; | ||
- | ||
-interface EmbeddedVerificationProps { | ||
- token: string; | ||
- methods: HumanVerificationMethodType[]; | ||
- defaultCountry?: string; | ||
- defaultEmail?: string; | ||
- defaultPhone?: string; | ||
- onSuccess: (token: string, tokenType: HumanVerificationMethodType) => void; | ||
-} | ||
- | ||
-const EmbeddedVerification = ({ | ||
- token, | ||
- methods, | ||
- onSuccess, | ||
- defaultCountry, | ||
- defaultEmail, | ||
- defaultPhone, | ||
-}: EmbeddedVerificationProps) => { | ||
- const iframeRef = useRef<HTMLIFrameElement>(null); | ||
- const [iframeHeight, setIframeHeight] = useState<number | undefined>(); | ||
- const { API_URL } = useConfig(); | ||
- const { createNotification } = useNotifications(); | ||
- | ||
- const embedUrl = useMemo(() => { | ||
- if (window.location.origin.includes('localhost')) { | ||
- return getAppUrlFromApiUrl(API_URL, APPS.PROTONVERIFICATION); | ||
- } | ||
- | ||
- return getAppUrlRelativeToOrigin(window.location.origin, APPS.PROTONVERIFICATION); | ||
- }, []); | ||
- | ||
- useEffect(() => { | ||
- const handleMessage = (e: MessageEvent) => { | ||
- const { origin, data, source } = e; | ||
- | ||
- const contentWindow = iframeRef.current?.contentWindow; | ||
- | ||
- if (!contentWindow || origin !== embedUrl.origin || !data || source !== contentWindow) { | ||
- return; | ||
- } | ||
- | ||
- const { type, payload } = JSON.parse(e.data); | ||
- | ||
- switch (type) { | ||
- case 'RESIZE': { | ||
- const { height } = payload; | ||
- setIframeHeight(height); | ||
- break; | ||
- } | ||
- | ||
- case 'NOTIFICATION': { | ||
- createNotification(payload); | ||
- break; | ||
- } | ||
- | ||
- case 'HUMAN_VERIFICATION_SUCCESS': { | ||
- const { token, type } = payload; | ||
- onSuccess(token, type); | ||
- break; | ||
- } | ||
- | ||
- default: | ||
- } | ||
- }; | ||
- | ||
- window.addEventListener('message', handleMessage); | ||
- | ||
- return () => { | ||
- window.removeEventListener('message', handleMessage); | ||
- }; | ||
- }, [onSuccess]); | ||
- | ||
- const params = { | ||
- methods, | ||
- token, | ||
- defaultCountry: defaultCountry || undefined, | ||
- defaultEmail: defaultEmail || undefined, | ||
- defaultPhone: defaultPhone || undefined, | ||
- locale: localeCode, | ||
- }; | ||
- | ||
- const src = `${embedUrl.toString()}?${stringifySearchParams(params)}`; | ||
- | ||
- return ( | ||
- <iframe | ||
- style={{ height: `${iframeHeight}px`, width: '100%' }} | ||
- src={src} | ||
- ref={iframeRef} | ||
- title="verification-iframe" | ||
- sandbox="allow-scripts allow-same-origin allow-popups" | ||
- /> | ||
- ); | ||
-}; | ||
- | ||
-export default EmbeddedVerification; | ||
|
||
diff --git a/packages/components/containers/verification/index.ts b/packages/components/containers/verification/index.ts | ||
deleted file mode 100644 | ||
index 8da2cc627..000000000 | ||
--- a/packages/components/containers/verification/index.ts | ||
+++ /dev/null | ||
@@ -1 +0,0 @@ | ||
-export { default as EmbeddedVerification } from './EmbeddedVerification' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,60 @@ | ||
{ | ||
"proton-mail": [ | ||
"common.patch", | ||
"constants-3.patch", | ||
"sentry-6.patch", | ||
"url-2.patch", | ||
"constants-4.patch", | ||
"sentry-8.patch", | ||
"pack-api-arg-3.patch", | ||
"pack-webpack-config-3.patch", | ||
"pack-webpack-4.patch", | ||
"session-storage-3.patch", | ||
"link-handler-5.patch", | ||
"embedded-verification-1.patch", | ||
"proton-mail.patch" | ||
], | ||
"proton-account": [ | ||
"common.patch", | ||
"constants-3.patch", | ||
"sentry-6.patch", | ||
"url-2.patch", | ||
"constants-4.patch", | ||
"sentry-8.patch", | ||
"pack-api-arg-3.patch", | ||
"pack-webpack-config-3.patch", | ||
"pack-webpack-4.patch", | ||
"session-storage-3.patch", | ||
"link-handler-5.patch", | ||
"embedded-verification-1.patch", | ||
"proton-account.patch" | ||
], | ||
"proton-calendar": [ | ||
"common.patch", | ||
"constants-3.patch", | ||
"sentry-6.patch", | ||
"url-2.patch", | ||
"constants-4.patch", | ||
"sentry-7.patch", | ||
"pack-api-arg-3.patch", | ||
"pack-webpack-config-3.patch", | ||
"pack-webpack-4.patch", | ||
"session-storage-3.patch", | ||
"link-handler-5.patch", | ||
"session-storage-3.patch" | ||
"embedded-verification-1.patch" | ||
], | ||
"proton-drive": [ | ||
"common.patch", | ||
"constants-3.patch", | ||
"sentry-6.patch", | ||
"url-2.patch", | ||
"constants-4.patch", | ||
"sentry-8.patch", | ||
"pack-api-arg-3.patch", | ||
"pack-webpack-config-3.patch", | ||
"pack-webpack-4.patch", | ||
"session-storage-3.patch", | ||
"link-handler-5.patch", | ||
"embedded-verification-1.patch", | ||
"proton-drive.patch" | ||
], | ||
"proton-vpn-settings": [ | ||
"common.patch", | ||
"constants-3.patch", | ||
"sentry-6.patch", | ||
"url-2.patch", | ||
"constants-4.patch", | ||
"sentry-8.patch", | ||
"pack-api-arg-3.patch", | ||
"pack-webpack-config-3.patch", | ||
"pack-webpack-4.patch", | ||
"session-storage-3.patch", | ||
"link-handler-5.patch" | ||
"link-handler-5.patch", | ||
"embedded-verification-1.patch" | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
...es/protonmail/pack-webpack-config-3.patch → patches/protonmail/pack-webpack-4.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.