feat: admin auth UI + fetch
This commit is contained in:
@@ -15,7 +15,7 @@ module.exports = {
|
||||
async authentication() { return {} }
|
||||
},
|
||||
AuthenticationQuery: {
|
||||
async providers(obj, args, context, info) {
|
||||
async strategies(obj, args, context, info) {
|
||||
let strategies = await WIKI.db.authentication.query().orderBy('title')
|
||||
strategies = strategies.map(stg => ({
|
||||
...stg,
|
||||
@@ -52,7 +52,7 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
},
|
||||
AuthenticationProvider: {
|
||||
AuthenticationStrategy: {
|
||||
icon (ap, args) {
|
||||
return fs.readFile(path.join(WIKI.ROOTPATH, `assets/svg/auth-icon-${ap.key}.svg`), 'utf8').catch(err => {
|
||||
if (err.code === 'ENOENT') {
|
||||
|
@@ -15,10 +15,10 @@ extend type Mutation {
|
||||
# -----------------------------------------------
|
||||
|
||||
type AuthenticationQuery {
|
||||
providers(
|
||||
strategies(
|
||||
filter: String
|
||||
orderBy: String
|
||||
): [AuthenticationProvider]
|
||||
): [AuthenticationStrategy]
|
||||
}
|
||||
|
||||
# -----------------------------------------------
|
||||
@@ -37,7 +37,7 @@ type AuthenticationMutation {
|
||||
securityCode: String!
|
||||
): DefaultResponse
|
||||
|
||||
updateProvider(
|
||||
updateStrategy(
|
||||
provider: String!
|
||||
isEnabled: Boolean!
|
||||
config: [KeyValuePairInput]
|
||||
@@ -48,7 +48,7 @@ type AuthenticationMutation {
|
||||
# TYPES
|
||||
# -----------------------------------------------
|
||||
|
||||
type AuthenticationProvider {
|
||||
type AuthenticationStrategy {
|
||||
isEnabled: Boolean!
|
||||
key: String!
|
||||
props: [String]
|
||||
|
Reference in New Issue
Block a user