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

This commit is contained in:
mike12345567 2021-10-01 13:29:08 +01:00
parent 0d45f8b6b0
commit 04acb160a2
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()