@@ -23,16 +23,16 @@ const config = require('yargs')
23
23
. help ( 'help' )
24
24
. parse ( )
25
25
26
- log . warn ( { config} , 'argv' )
26
+ log . debug ( { config} , 'argv' )
27
27
28
- const printCertificate = ( certif ) => `Certificate(${ certif . issuerName } ${ certif . subjectName } )`
28
+ const formatCertificate = ( certif ) => `Certificate(${ certif . issuerName } ${ certif . subjectName } )`
29
29
30
30
module . exports = ( app , session , doneSetup ) => {
31
31
const loginByRealm = { }
32
32
if ( config [ 'login-by-realm' ] ) {
33
33
config [ 'login-by-realm' ] . split ( ',' ) . forEach ( ( lbr ) => {
34
- const [ realm , username , password ] = lbr . split ( ':' )
35
- loginByRealm [ realm ] = [ username , password ]
34
+ const [ realm , username , ... password ] = lbr . split ( ':' )
35
+ loginByRealm [ realm ] = [ username , password . join ( ':' ) ]
36
36
} )
37
37
}
38
38
@@ -43,9 +43,9 @@ module.exports = (app, session, doneSetup) => {
43
43
session . defaultSession . setCertificateVerifyProc ( ( request , callback ) => {
44
44
const { hostname, certificate, verificationResult, errorCode} = request
45
45
if ( verificationResult < 0 ) {
46
- log . warn ( { hostname, certificate : printCertificate ( certificate ) , verificationResult, errorCode} , 'Certificate Verification Error' )
46
+ log . warn ( { hostname, certificate : formatCertificate ( certificate ) , verificationResult, errorCode} , 'Certificate Verification Error' )
47
47
} else {
48
- log . debug ( { hostname, certificate : printCertificate ( certificate ) , verificationResult, errorCode} , 'Certificate Validated' )
48
+ log . debug ( { hostname, certificate : formatCertificate ( certificate ) , verificationResult, errorCode} , 'Certificate Validated' )
49
49
}
50
50
callback ( - 3 ) // use chrome validation
51
51
} )
@@ -56,12 +56,12 @@ module.exports = (app, session, doneSetup) => {
56
56
} )
57
57
58
58
app . on ( 'certificate-error' , ( event , webContents , url , error , certificate , callback ) => {
59
- log . warn ( { url, error, certificate : printCertificate ( certificate ) } , 'App Certificate Error' )
59
+ log . warn ( { url, error, certificate : formatCertificate ( certificate ) } , 'App Certificate Error' )
60
60
callback ( false )
61
61
} )
62
62
63
63
app . on ( 'login' , ( event , webContents , request , authInfo , callback ) => {
64
- log . warn ( { request : request . method + ' ' + request . url , authInfo} , 'Login event' )
64
+ log . debug ( { request : request . method + ' ' + request . url , authInfo} , 'Login event' )
65
65
const auth = loginByRealm [ authInfo . realm ]
66
66
if ( auth ) {
67
67
event . preventDefault ( )
0 commit comments