diff --git a/.github/workflows/deploy-v3/action.yaml b/.github/workflows/deploy-v3/action.yaml index 8f7d9b7a7..810a0e6c1 100644 --- a/.github/workflows/deploy-v3/action.yaml +++ b/.github/workflows/deploy-v3/action.yaml @@ -29,7 +29,7 @@ inputs: description: 'Tenant URL for Fotoware application' required: true fotowareRedirectOrigin: - description: 'Redirect URL for Fotoware auth' + description: 'Redirect Origin for Fotoware auth' required: true fotowareAfExportUrl: description: 'Azure Function img export URL' @@ -105,6 +105,7 @@ runs: --build-arg ARG_FOTOWARE_CLIENT_ID="${{ inputs.fotowareClientId }}" \ --build-arg ARG_FOTOWARE_TENANT_URL="${{ inputs.fotowareTenantUrl }}" \ --build-arg ARG_FOTOWARE_REDIRECT_ORIGIN="${{ inputs.fotowareRedirectOrigin }}" \ + --build-arg ARG_FOTOWARE_REDIRECT_URI="${{ inputs.fotowareRedirectUri }}" \ --build-arg ARG_FOTOWARE_AF_EXPORT_URL="${{ inputs.fotowareAfExportUrl }}" \ --build-arg ARG_FOTOWARE_AF_EXPORT_KEY="${{ inputs.fotowareAfExportKey }}" \ --build-arg ARG_SCREEN9_ACCOUNT_ID="${{ inputs.screen9accountId }}" \ diff --git a/.github/workflows/studios-rollback.yaml b/.github/workflows/studios-rollback.yaml index b4c74f8a8..648ef5e06 100644 --- a/.github/workflows/studios-rollback.yaml +++ b/.github/workflows/studios-rollback.yaml @@ -148,6 +148,7 @@ jobs: SANITY_STUDIO_FOTOWARE_CLIENT_ID: ${{ secrets.SANITY_STUDIO_FOTOWARE_CLIENT_ID }} SANITY_STUDIO_FOTOWARE_TENANT_URL: ${{ secrets.SANITY_STUDIO_FOTOWARE_TENANT_URL }} SANITY_STUDIO_FOTOWARE_REDIRECT_ORIGIN: ${{ secrets.SANITY_STUDIO_FOTOWARE_REDIRECT_ORIGIN }} + SANITY_STUDIO_FOTOWARE_REDIRECT_URI: ${{ secrets.SANITY_STUDIO_FOTOWARE_REDIRECT_URI }} SANITY_STUDIO_FOTOWARE_AF_EXPORT_URL: ${{ secrets.SANITY_STUDIO_FOTOWARE_AF_EXPORT_URL }} SANITY_STUDIO_FOTOWARE_AF_EXPORT_KEY: ${{ secrets.SANITY_STUDIO_FOTOWARE_AF_EXPORT_KEY }} DOCKER_BUILDKIT: 1 diff --git a/sanityv3/plugins/asset-source-fotoware/src/FotowareAssetSource.tsx b/sanityv3/plugins/asset-source-fotoware/src/FotowareAssetSource.tsx index 514da58bb..bbaab48cd 100644 --- a/sanityv3/plugins/asset-source-fotoware/src/FotowareAssetSource.tsx +++ b/sanityv3/plugins/asset-source-fotoware/src/FotowareAssetSource.tsx @@ -40,9 +40,9 @@ const FotowareAssetSource = forwardRef((props: any, ref) => { const handleAuthEvent = useCallback( (event: any) => { const validateAuthEvent = () => { - if (event.origin !== REDIRECT_ORIGIN) { + /* if (event.origin !== REDIRECT_ORIGIN) { return handleRequestError(`Invalid event origin: ${event.origin}`, setError, 'auth', newWindow) - } + } */ if (event.data?.error) { const { error, error_description } = event.data @@ -175,6 +175,7 @@ const FotowareAssetSource = forwardRef((props: any, ref) => { }, [accessToken, handleAuthEvent]) useEffect(() => { + //should not add listener before access token is present? window.addEventListener('message', handleWidgetEvent) setContainer(document.createElement('div'))