From 433ad41867eac64c4f21d1f14c9eb5083026d2ab Mon Sep 17 00:00:00 2001 From: Erik Hanson Date: Tue, 10 Dec 2024 11:06:32 -0800 Subject: [PATCH] WIP: More Invitation fixes --- .../acceptInvitation/AcceptInvitationPage.vue | 2 +- .../AcceptInvitationVerifyOrcid.vue | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/pages/acceptInvitation/AcceptInvitationPage.vue b/src/pages/acceptInvitation/AcceptInvitationPage.vue index 098eeefdd..2676d9124 100644 --- a/src/pages/acceptInvitation/AcceptInvitationPage.vue +++ b/src/pages/acceptInvitation/AcceptInvitationPage.vue @@ -57,7 +57,7 @@ {{ t('common.back') }} diff --git a/src/pages/acceptInvitation/AcceptInvitationVerifyOrcid.vue b/src/pages/acceptInvitation/AcceptInvitationVerifyOrcid.vue index 8ff6e004f..2ece773f3 100644 --- a/src/pages/acceptInvitation/AcceptInvitationVerifyOrcid.vue +++ b/src/pages/acceptInvitation/AcceptInvitationVerifyOrcid.vue @@ -19,7 +19,11 @@ import {defineProps} from 'vue'; import {useLocalize} from '@/composables/useLocalize'; import {useAcceptInvitationPageStore} from './AcceptInvitationPageStore'; -defineProps({}); +const props = defineProps({ + orcidUrl: {type: String, required: true}, + orcidOAuthUrl: {type: String, required: true}, +}); + const store = useAcceptInvitationPageStore(); const {t} = useLocalize(); @@ -28,10 +32,20 @@ const {t} = useLocalize(); */ function skipOrcid() { delete store.acceptInvitationPayload.userOrcid; - store.openStep(store.steps[1 + store.currentStepIndex].id); + store.openStep(store.steps.value[1 + store.currentStepIndex].id); } function verifyOrcid() { - store.openStep(store.steps[1 + store.currentStepIndex].id); + openOrcidOAuth(); + store.openStep(store.steps.value[1 + store.currentStepIndex].id); +} + +function openOrcidOAuth() { + const oauthWindow = window.open( + props.orcidOAuthUrl, + '_blank', + 'toolbar=no, scrollbars=yes, width=540, height=700, top=500, left=500', + ); + oauthWindow.opener = self; }