Skip to content

Commit

Permalink
add auth basepath
Browse files Browse the repository at this point in the history
  • Loading branch information
Melisa Anabella Rossi committed Mar 7, 2024
1 parent e6e81ae commit 68ad468
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@
},
"dependencies": {
"@dcl/crypto": "^3.4.5",
"@dcl/hashing": "^3.0.4",
"@dcl/schemas": "^9.8.0",
"@dcl/single-sign-on-client": "^0.1.0",
"@dcl/ui-env": "^1.4.0",
"@magic-ext/oauth": "^15.1.1",
"@well-known-components/fetch-component": "^2.0.2",
"ajv": "^8.12.0",
"classnames": "^2.3.2",
"dcl-catalyst-client": "^21.5.5",
"decentraland-connect": "^6.2.0",
"decentraland-ui": "^5.2.0",
"decentraland-connect": "^5.2.4",
"decentraland-ui": "^4.31.2",
"ethers": "^6.8.0",
"magic-sdk": "^21.2.0",
"react": "^17.0.2",
Expand All @@ -46,6 +43,8 @@
},
"devDependencies": {
"@dcl/eslint-config": "^1.1.12",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@swc/core": "^1.3.96",
"@swc/jest": "^0.2.29",
"@testing-library/jest-dom": "^5.17.0",
Expand All @@ -65,11 +64,11 @@
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"rollup-plugin-polyfill-node": "^0.13.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.0.2",
"vite": "^4.4.5",
"vite-plugin-node-polyfills": "^0.19.0"
"vite": "^4.4.5"
},
"homepage": ""
}
13 changes: 12 additions & 1 deletion scripts/prebuild.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ publicPackageJson.homepage = packageJson.homepage
if (packageJson.homepage) {
// github action outputs. Do not touch.
console.log('::set-output name=public_url::' + packageJson.homepage)
console.log('::set-output name=public_path::' + new URL(packageJson.homepage).pathname)
let pathname = ""
try {
pathname = new URL(packageJson.homepage).pathname
} catch {
pathname = packageJson.homepage
}
console.log('::set-output name=public_path::' + pathname)
}

// log stuff
Expand Down Expand Up @@ -57,6 +63,11 @@ function getPublicUrls() {
VITE_BASE_URL: cdnUrl
}
}
if (isVercel) {
return {
VITE_BASE_URL: "/"
}
}
// localhost
console.log('Using empty pubic url')
return {
Expand Down
9 changes: 5 additions & 4 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"github": {
"silent": true
},
"rewrites": [
"redirects": [
{
"source": "/(.*)",
"destination": "/"
"source": "/",
"destination": "/auth"
}
]
],
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
}

0 comments on commit 68ad468

Please sign in to comment.