reinstated basic auth

This commit is contained in:
2021-11-25 10:02:30 +00:00
parent fc31b857b2
commit fa4b81c56f
2 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ RELAYPATH = "test-pedw-hc"
GOOGLE_TAG_MANAGER = GTM-T78CBC3
SHOWLOGIN = "true"
SHOWREPRESENTATIONS = "false"
//BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2
BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2
PORT= "3000"
+10 -10
View File
@@ -9,18 +9,18 @@ class MyDocument extends Document {
let useGATracking = false;
// remove this block when not need after softlaunch
// let hasBasicAuth =
// typeof process.env.BASIC_AUTH_CREDENTIALS != "undefined";
//remove this block when not need after softlaunch
let hasBasicAuth =
typeof process.env.BASIC_AUTH_CREDENTIALS != "undefined";
// console.log(hasBasicAuth);
console.log(hasBasicAuth);
// if (ctx.req && ctx.res) {
// hasBasicAuth &&
// (await basicAuthMiddleware(ctx.req, ctx.res, {
// users: process.env.BASIC_AUTH_CREDENTIALS,
// }));
// }
if (ctx.req && ctx.res) {
hasBasicAuth &&
(await basicAuthMiddleware(ctx.req, ctx.res, {
users: process.env.BASIC_AUTH_CREDENTIALS,
}));
}
if (ctx.req && ctx.req.headers.cookie) {
typeof ctx.req.cookies.CookiePolicy != "undefined"