From 7ffd0f7490f50cdad567cd8a94022a64301ea626 Mon Sep 17 00:00:00 2001 From: Kristaps Fabians Geikins Date: Wed, 5 Jun 2024 13:48:22 +0300 Subject: [PATCH] fix(fe2): using SSR apiOrigin instead of CSR apiOrigin in vue templates (#2326) --- .../components/auth/third-party/LoginBlock.vue | 7 ++++++- .../components/developer-settings/SectionHeader.vue | 8 +++++++- packages/frontend-2/composables/env.ts | 4 ++++ packages/frontend-2/pages/developer-settings.vue | 10 ++++++---- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/packages/frontend-2/components/auth/third-party/LoginBlock.vue b/packages/frontend-2/components/auth/third-party/LoginBlock.vue index 059e34acb..891b31004 100644 --- a/packages/frontend-2/components/auth/third-party/LoginBlock.vue +++ b/packages/frontend-2/components/auth/third-party/LoginBlock.vue @@ -5,7 +5,7 @@ :is="getButtonComponent(strat)" v-for="strat in thirdPartyStrategies" :key="strat.id" - :to="buildAuthUrl(strat)" + to="javascript:;" @click="() => onClick(strat)" /> @@ -93,10 +93,15 @@ const getButtonComponent = (strat: StrategyType) => { } const onClick = (strat: StrategyType) => { + if (!process.client) return + + const redirectUrl = buildAuthUrl(strat) mixpanel.track('Log In', { isInvite: !!inviteToken.value, type: 'action', provider: strat.name }) + + window.location.href = redirectUrl } diff --git a/packages/frontend-2/components/developer-settings/SectionHeader.vue b/packages/frontend-2/components/developer-settings/SectionHeader.vue index 4b15fae01..9ea40ef41 100644 --- a/packages/frontend-2/components/developer-settings/SectionHeader.vue +++ b/packages/frontend-2/components/developer-settings/SectionHeader.vue @@ -9,6 +9,7 @@ :key="index" v-bind="button.props" class="shrink-0 whitespace-nowrap" + @click="($event) => button.onClick?.($event)" > {{ button.label }} @@ -21,9 +22,14 @@