1
0
Fork 0
mirror of synced 2024-07-01 20:41:03 +12:00

Merge pull request #2844 from Budibase/fix/smtp-automation

Fixing server -> worker internal comms
This commit is contained in:
Michael Drury 2021-10-01 15:01:37 +01:00 committed by GitHub
commit a01eb8aaa0
2 changed files with 3 additions and 2 deletions

View file

@ -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()
}

View file

@ -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()