|
|
|
@ -3,14 +3,7 @@ const STATUS_CODES = require("../utilities/statusCodes") |
|
|
|
const env = require("../environment") |
|
|
|
|
|
|
|
module.exports = async (ctx, next) => { |
|
|
|
const authHeader = ctx.get("Authorization") |
|
|
|
|
|
|
|
if ( |
|
|
|
authHeader && |
|
|
|
authHeader.startsWith("Basic") && |
|
|
|
authHeader.split(" ")[1] === env.ADMIN_SECRET |
|
|
|
) { |
|
|
|
ctx.isAuthenticated = true |
|
|
|
if (ctx.path === "/_builder") { |
|
|
|
await next() |
|
|
|
return |
|
|
|
} |
|
|
|
|