feat: admin auth UI + fetch

This commit is contained in:
NGPixel
2018-06-04 00:41:29 -04:00
parent dd318eb2db
commit 5efbfc7370
10 changed files with 2457 additions and 3615 deletions

View File

@@ -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') {

View File

@@ -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]