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
1ced9649
You need to sign in or sign up before continuing.
Commit
1ced9649
authored
Jul 05, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: enforce 2fa admin setting + hide local on login screen
parent
b8d15915
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
6 deletions
+25
-6
admin-security.vue
client/components/admin/admin-security.vue
+4
-0
login.vue
client/components/login.vue
+16
-6
data.yml
server/app/data.yml
+1
-0
site.js
server/graph/resolvers/site.js
+2
-0
site.graphql
server/graph/schemas/site.graphql
+2
-0
No files found.
client/components/admin/admin-security.vue
View file @
1ced9649
...
...
@@ -278,6 +278,7 @@ export default {
mutation
:
gql
`
mutation (
$authAutoLogin: Boolean
$authEnforce2FA: Boolean
$authHideLocal: Boolean
$authLoginBgUrl: String
$authJwtAudience: String
...
...
@@ -298,6 +299,7 @@ export default {
site {
updateConfig(
authAutoLogin: $authAutoLogin,
authEnforce2FA: $authEnforce2FA,
authHideLocal: $authHideLocal,
authLoginBgUrl: $authLoginBgUrl,
authJwtAudience: $authJwtAudience,
...
...
@@ -327,6 +329,7 @@ export default {
`
,
variables
:
{
authAutoLogin
:
_
.
get
(
this
.
config
,
'authAutoLogin'
,
false
),
authEnforce2FA
:
_
.
get
(
this
.
config
,
'authEnforce2FA'
,
false
),
authHideLocal
:
_
.
get
(
this
.
config
,
'authHideLocal'
,
false
),
authLoginBgUrl
:
_
.
get
(
this
.
config
,
'authLoginBgUrl'
,
''
),
authJwtAudience
:
_
.
get
(
this
.
config
,
'authJwtAudience'
,
''
),
...
...
@@ -377,6 +380,7 @@ export default {
site {
config {
authAutoLogin
authEnforce2FA
authHideLocal
authLoginBgUrl
authJwtAudience
...
...
client/components/login.vue
View file @
1ced9649
...
...
@@ -18,7 +18,7 @@
v-list.elevation-1.radius-7(nav)
v-list-item-group(v-model='selectedStrategyKey')
v-list-item(
v-for='(stg, idx) of
s
trategies'
v-for='(stg, idx) of
filteredS
trategies'
:key='stg.key'
:value='stg.key'
:color='stg.strategy.color'
...
...
@@ -252,8 +252,8 @@ export default {
return
{
error
:
false
,
strategies
:
[],
selectedStrategyKey
:
'
local
'
,
selectedStrategy
:
{
key
:
'
local'
,
strategy
:
{
useForm
:
tru
e
}
}
,
selectedStrategyKey
:
'
unselected
'
,
selectedStrategy
:
{
key
:
'
unselected'
,
strategy
:
{
useForm
:
fals
e
}
}
,
screen
:
'login'
,
username
:
''
,
password
:
''
,
...
...
@@ -276,11 +276,21 @@ export default {
isSocialShown
()
{
return
this
.
strategies
.
length
>
1
}
,
logoUrl
()
{
return
siteConfig
.
logoUrl
}
logoUrl
()
{
return
siteConfig
.
logoUrl
}
,
filteredStrategies
()
{
const
qParams
=
new
URLSearchParams
(
window
.
location
.
search
)
if
(
this
.
hideLocal
&&
!
qParams
.
has
(
'all'
))
{
return
_
.
reject
(
this
.
strategies
,
[
'key'
,
'local'
])
}
else
{
return
this
.
strategies
}
}
}
,
watch
:
{
strategies
(
newValue
,
oldValue
)
{
this
.
selectedStrategy
=
_
.
head
(
newValue
)
filteredStrategies
(
newValue
,
oldValue
)
{
if
(
_
.
head
(
newValue
).
strategy
.
useForm
)
{
this
.
selectedStrategyKey
=
_
.
head
(
newValue
).
key
}
}
,
selectedStrategyKey
(
newValue
,
oldValue
)
{
this
.
selectedStrategy
=
_
.
find
(
this
.
strategies
,
[
'key'
,
newValue
])
...
...
server/app/data.yml
View file @
1ced9649
...
...
@@ -55,6 +55,7 @@ defaults:
darkMode
:
false
auth
:
autoLogin
:
false
enforce2FA
:
false
hideLocal
:
false
loginBgUrl
:
'
'
audience
:
'
urn:wiki.js'
...
...
server/graph/resolvers/site.js
View file @
1ced9649
...
...
@@ -22,6 +22,7 @@ module.exports = {
...
WIKI
.
config
.
features
,
...
WIKI
.
config
.
security
,
authAutoLogin
:
WIKI
.
config
.
auth
.
autoLogin
,
authEnforce2FA
:
WIKI
.
config
.
auth
.
enforce2FA
,
authHideLocal
:
WIKI
.
config
.
auth
.
hideLocal
,
authLoginBgUrl
:
WIKI
.
config
.
auth
.
loginBgUrl
,
authJwtAudience
:
WIKI
.
config
.
auth
.
audience
,
...
...
@@ -68,6 +69,7 @@ module.exports = {
WIKI
.
config
.
auth
=
{
autoLogin
:
_
.
get
(
args
,
'authAutoLogin'
,
WIKI
.
config
.
auth
.
autoLogin
),
enforce2FA
:
_
.
get
(
args
,
'authEnforce2FA'
,
WIKI
.
config
.
auth
.
enforce2FA
),
hideLocal
:
_
.
get
(
args
,
'authHideLocal'
,
WIKI
.
config
.
auth
.
hideLocal
),
loginBgUrl
:
_
.
get
(
args
,
'authLoginBgUrl'
,
WIKI
.
config
.
auth
.
loginBgUrl
),
audience
:
_
.
get
(
args
,
'authJwtAudience'
,
WIKI
.
config
.
auth
.
audience
),
...
...
server/graph/schemas/site.graphql
View file @
1ced9649
...
...
@@ -34,6 +34,7 @@ type SiteMutation {
contentLicense
:
String
logoUrl
:
String
authAutoLogin
:
Boolean
authEnforce2FA
:
Boolean
authHideLocal
:
Boolean
authLoginBgUrl
:
String
authJwtAudience
:
String
...
...
@@ -72,6 +73,7 @@ type SiteConfig {
contentLicense
:
String
!
logoUrl
:
String
!
authAutoLogin
:
Boolean
authEnforce2FA
:
Boolean
authHideLocal
:
Boolean
authLoginBgUrl
:
String
authJwtAudience
:
String
...
...
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