diff --git a/plugins/calendar-resources/src/components/IntegrationConnect.svelte b/plugins/calendar-resources/src/components/IntegrationConnect.svelte index daee6355d9..56b7cee3e0 100644 --- a/plugins/calendar-resources/src/components/IntegrationConnect.svelte +++ b/plugins/calendar-resources/src/components/IntegrationConnect.svelte @@ -30,7 +30,7 @@ const link = concatLink(calendarUrl, '/signin') const url = new URL(link) url.search = new URLSearchParams({ - redirectURL: window.location.href + redirectURL: (getMetadata(presentation.metadata.FrontUrl) ?? window.location.origin) + window.location.pathname }).toString() const res = await fetch(url.toString(), { @@ -41,7 +41,8 @@ } }) const redirectTo = await res.text() - window.open(redirectTo, '_self') + window.open(redirectTo) + dispatch('close') } diff --git a/plugins/gmail-resources/src/components/Connect.svelte b/plugins/gmail-resources/src/components/Connect.svelte index 0ace682cad..9804580ada 100644 --- a/plugins/gmail-resources/src/components/Connect.svelte +++ b/plugins/gmail-resources/src/components/Connect.svelte @@ -31,7 +31,7 @@ const link = concatLink(gmailUrl, '/signin') const url = new URL(link) url.search = new URLSearchParams({ - redirectURL: window.location.href + redirectURL: (getMetadata(presentation.metadata.FrontUrl) ?? window.location.origin) + window.location.pathname }).toString() const res = await fetch(url.toString(), { @@ -42,7 +42,8 @@ } }) const redirectTo = await res.text() - window.open(redirectTo, '_self') + window.open(redirectTo) + dispatch('close') }