Browse Source
Merge pull request #2844 from Budibase/fix/smtp-automation
Fixing server -> worker internal comms
gh-pages
Michael Drury
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
2 deletions
-
packages/server/src/utilities/workerRequests.js
-
packages/worker/src/api/index.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() |
|
|
|
} |
|
|
|
|
|
|
|
@ -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() |
|
|
|
|