1- import { Context , Env , WebConfig , MobileConfig } from '../types.js'
1+ import { Context , Env , WebConfig , MobileConfig , basicAuth } from '../types.js'
22import constants from './constants.js'
33import { version } from '../../package.json'
44import { validateConfig } from './schemaValidation.js'
@@ -11,6 +11,7 @@ export default (options: Record<string, string>): Context => {
1111 let env : Env = getEnv ( ) ;
1212 let webConfig : WebConfig ;
1313 let mobileConfig : MobileConfig ;
14+ let basicAuthObj : basicAuth
1415 let config = constants . DEFAULT_CONFIG ;
1516 let port : number ;
1617 let resolutionOff : boolean ;
@@ -57,6 +58,12 @@ export default (options: Record<string, string>): Context => {
5758 }
5859 }
5960
61+ console . dir ( basicAuthObj )
62+ console . log ( "**************" )
63+ if ( config . basicAuthorization ) {
64+ basicAuthObj = config . basicAuthorization
65+ }
66+
6067 return {
6168 env : env ,
6269 log : logger ,
@@ -70,7 +77,7 @@ export default (options: Record<string, string>): Context => {
7077 cliEnableJavaScript : config . cliEnableJavaScript || true ,
7178 scrollTime : config . scrollTime || constants . DEFAULT_SCROLL_TIME ,
7279 allowedHostnames : config . allowedHostnames || [ ] ,
73- basicAuthorization : config . basicAuthorization || { username : '' , password : '' }
80+ basicAuthorization : basicAuthObj
7481 } ,
7582 uploadFilePath : '' ,
7683 webStaticConfig : [ ] ,
0 commit comments