summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/admin
diff options
context:
space:
mode:
authorAcid Chicken (硫酸鶏) <root@acid-chicken.com>2018-11-15 19:15:04 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2018-11-15 19:15:04 +0900
commit9d8f7b081d8c47027583b3085923e2128f622b98 (patch)
treebadb8b660018fd4967b946cbe65d48650b88110f /src/server/api/endpoints/admin
parent10.51.2 (diff)
downloadsharkey-9d8f7b081d8c47027583b3085923e2128f622b98.tar.gz
sharkey-9d8f7b081d8c47027583b3085923e2128f622b98.tar.bz2
sharkey-9d8f7b081d8c47027583b3085923e2128f622b98.zip
WIP: Add Discord auth (#3239)
* Add Discord auth * Apply review 175263424
Diffstat (limited to 'src/server/api/endpoints/admin')
-rw-r--r--src/server/api/endpoints/admin/update-meta.ts35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts
index 1e4ff959d9..bbae212bd7 100644
--- a/src/server/api/endpoints/admin/update-meta.ts
+++ b/src/server/api/endpoints/admin/update-meta.ts
@@ -177,9 +177,30 @@ export const meta = {
githubClientSecret: {
validator: $.str.optional.nullable,
desc: {
- 'ja-JP': 'GitHubアプリのClient secret'
+ 'ja-JP': 'GitHubアプリのClient Secret'
}
},
+
+ enableDiscordIntegration: {
+ validator: $.bool.optional,
+ desc: {
+ 'ja-JP': 'Discord連携機能を有効にするか否か'
+ }
+ },
+
+ discordClientId: {
+ validator: $.str.optional.nullable,
+ desc: {
+ 'ja-JP': 'DiscordアプリのClient ID'
+ }
+ },
+
+ discordClientSecret: {
+ validator: $.str.optional.nullable,
+ desc: {
+ 'ja-JP': 'DiscordアプリのClient Secret'
+ }
+ }
}
};
@@ -282,6 +303,18 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
set.githubClientSecret = ps.githubClientSecret;
}
+ if (ps.enableDiscordIntegration !== undefined) {
+ set.enableDiscordIntegration = ps.enableDiscordIntegration;
+ }
+
+ if (ps.discordClientId !== undefined) {
+ set.discordClientId = ps.discordClientId;
+ }
+
+ if (ps.discordClientSecret !== undefined) {
+ set.discordClientSecret = ps.discordClientSecret;
+ }
+
await Meta.update({}, {
$set: set
}, { upsert: true });