Browse Source

Merge pull request #2880 from Budibase/fix/2835

Fix for shorthand app URL not re-directing if the user isn't logged in
pull/2883/head
Michael Drury 5 years ago
committed by GitHub
parent
commit
079b4f4633
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/server/src/api/controllers/application.js
  2. 2
      packages/server/src/api/controllers/hosting.js
  3. 2
      packages/server/src/api/controllers/static/index.js
  4. 4
      packages/server/src/utilities/workerRequests.js

2
packages/server/src/api/controllers/application.js

@ -82,7 +82,7 @@ async function getAppUrlIfNotInUse(ctx) {
if (!env.SELF_HOSTED) {
return url
}
const deployedApps = await getDeployedApps(ctx)
const deployedApps = await getDeployedApps()
if (
url &&
deployedApps[url] != null &&

2
packages/server/src/api/controllers/hosting.js

@ -18,5 +18,5 @@ exports.fetchUrls = async ctx => {
}
exports.getDeployedApps = async ctx => {
ctx.body = await getDeployedApps(ctx)
ctx.body = await getDeployedApps()
}

2
packages/server/src/api/controllers/static/index.js

@ -40,7 +40,7 @@ async function prepareUpload({ s3Key, bucket, metadata, file }) {
async function checkForSelfHostedURL(ctx) {
// the "appId" component of the URL may actually be a specific self hosted URL
let possibleAppUrl = `/${encodeURI(ctx.params.appId).toLowerCase()}`
const apps = await getDeployedApps(ctx)
const apps = await getDeployedApps()
if (apps[possibleAppUrl] && apps[possibleAppUrl].appId) {
return apps[possibleAppUrl].appId
} else {

4
packages/server/src/utilities/workerRequests.js

@ -58,11 +58,11 @@ exports.sendSmtpEmail = async (to, from, subject, contents, automation) => {
return response.json()
}
exports.getDeployedApps = async ctx => {
exports.getDeployedApps = async () => {
try {
const response = await fetch(
checkSlashesInUrl(env.WORKER_URL + `/api/apps`),
request(ctx, {
request(null, {
method: "GET",
})
)

Loading…
Cancel
Save