Skip to content

Commit

Permalink
Add some more logging and skip one origin test in auth #2655 (#2656)
Browse files Browse the repository at this point in the history
* 🎨 more logging and remove origin test in auth for now

* 🎨 remove one logging

* 🎨 add separate uri and origin into two secrets

* 🎨 cleanup some logging

* 🎨 change to skip origin instead

* 🎨 cleanup docker arg
  • Loading branch information
BorghildSelle authored Nov 14, 2024
1 parent 7f1140c commit 76e393b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy-v3/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 }}" \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/studios-rollback.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const FotowareAssetSource = forwardRef<HTMLDivElement>((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
Expand Down Expand Up @@ -175,6 +175,7 @@ const FotowareAssetSource = forwardRef<HTMLDivElement>((props: any, ref) => {
}, [accessToken, handleAuthEvent])

useEffect(() => {
//should not add listener before access token is present?
window.addEventListener('message', handleWidgetEvent)
setContainer(document.createElement('div'))

Expand Down

0 comments on commit 76e393b

Please sign in to comment.