Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
922f179a
Commit
922f179a
authored
Jun 04, 2019
by
Nick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: LDAP debug flag
parent
3d73ff5d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
12 deletions
+18
-12
admin-dev-flags.vue
client/components/admin/admin-dev-flags.vue
+8
-9
data.yml
server/app/data.yml
+1
-0
auth.js
server/core/auth.js
+0
-1
authentication.js
server/graph/resolvers/authentication.js
+5
-0
site.js
server/graph/resolvers/site.js
+0
-1
graph.js
server/helpers/graph.js
+1
-1
authentication.js
server/modules/authentication/ldap/authentication.js
+3
-0
No files found.
client/components/admin/admin-dev-flags.vue
View file @
922f179a
...
...
@@ -18,21 +18,20 @@
.caption Doing so may result in data loss or broken installation!
v-card-text
v-switch.mt-3(
color='primary'
hint='Log detailed debug info on LDAP/AD login attempts.'
persistent-hint
label='LDAP Debug'
v-model='flags.ldapdebug'
)
v-divider.mt-3
v-switch.mt-3(
color='red'
hint='Log all queries made to the database to console.'
persistent-hint
label='SQL Query Logging'
v-model='flags.sqllog'
)
//- v-divider.mt-3
//- v-switch.mt-3(
//- color='primary'
//- hint='Log all queries made to the database to console.'
//- persistent-hint
//- label='SQL Query Log'
//- v-model='flags.sqllog'
//- )
</
template
>
<
script
>
...
...
server/app/data.yml
View file @
922f179a
...
...
@@ -39,6 +39,7 @@ defaults:
theme
:
'
default'
darkMode
:
false
flags
:
ldapdebug
:
false
sqllog
:
false
# System defaults
setup
:
false
...
...
server/core/auth.js
View file @
922f179a
const
passport
=
require
(
'passport'
)
const
passportJWT
=
require
(
'passport-jwt'
)
const
fs
=
require
(
'fs-extra'
)
const
_
=
require
(
'lodash'
)
const
path
=
require
(
'path'
)
const
jwt
=
require
(
'jsonwebtoken'
)
...
...
server/graph/resolvers/authentication.js
View file @
922f179a
...
...
@@ -44,6 +44,11 @@ module.exports = {
responseResult
:
graphHelper
.
generateSuccess
(
'Login success'
)
}
}
catch
(
err
)
{
// LDAP Debug Flag
if
(
args
.
strategy
===
'ldap'
&&
WIKI
.
config
.
flags
.
ldapdebug
)
{
WIKI
.
logger
.
warn
(
'LDAP LOGIN ERROR (c1): '
,
err
)
}
return
graphHelper
.
generateError
(
err
)
}
},
...
...
server/graph/resolvers/site.js
View file @
922f179a
const
_
=
require
(
'lodash'
)
const
graphHelper
=
require
(
'../../helpers/graph'
)
/* global WIKI */
...
...
server/helpers/graph.js
View file @
922f179a
...
...
@@ -13,7 +13,7 @@ module.exports = {
generateError
(
err
,
complete
=
true
)
{
const
error
=
{
succeeded
:
false
,
errorCode
:
err
.
code
||
1
,
errorCode
:
_
.
isFinite
(
err
.
code
)
?
err
.
code
:
1
,
slug
:
err
.
name
,
message
:
err
.
message
||
'An unexpected error occured.'
}
...
...
server/modules/authentication/ldap/authentication.js
View file @
922f179a
...
...
@@ -45,6 +45,9 @@ module.exports = {
})
cb
(
null
,
user
)
}
catch
(
err
)
{
if
(
WIKI
.
config
.
flags
.
ldapdebug
)
{
WIKI
.
logger
.
warn
(
'LDAP LOGIN ERROR (c2): '
,
err
)
}
cb
(
err
,
null
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment