Browse Source

Quick fix for worker, API key was not considered good enough to access worker, updated this and added better error to smtp action.

pull/2844/head
mike12345567 5 years ago
parent
commit
04acb160a2
  1. 3
      packages/server/src/utilities/workerRequests.js
  2. 2
      packages/worker/src/api/index.js

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

@ -52,7 +52,8 @@ exports.sendSmtpEmail = async (to, from, subject, contents, automation) => {
)
if (response.status !== 200) {
throw "Unable to send email."
const error = await response.text()
throw `Unable to send email - ${error}`
}
return response.json()
}

2
packages/worker/src/api/index.js

@ -87,7 +87,7 @@ router
if (ctx.publicEndpoint) {
return next()
}
if (!ctx.isAuthenticated || !ctx.user.budibaseAccess) {
if ((!ctx.isAuthenticated || !ctx.user.budibaseAccess) && !ctx.internal) {
ctx.throw(403, "Unauthorized - no public worker access")
}
return next()

Loading…
Cancel
Save