2021-01-06 17:58:29 +01:00
|
|
|
const env = require("../environment")
|
|
|
|
|
2020-12-16 20:50:02 +01:00
|
|
|
module.exports = async (ctx, next) => {
|
2021-01-06 18:28:22 +01:00
|
|
|
if (
|
|
|
|
!ctx.request.body.selfHostKey ||
|
|
|
|
env.SELF_HOST_KEY !== ctx.request.body.selfHostKey
|
|
|
|
) {
|
2021-01-06 17:58:29 +01:00
|
|
|
ctx.throw(401, "Deployment unauthorised")
|
|
|
|
} else {
|
|
|
|
await next()
|
|
|
|
}
|
2020-12-16 20:50:02 +01:00
|
|
|
}
|