WIP: Add Discord auth (#3239)

* Add Discord auth

* Apply review 175263424
This commit is contained in:
Acid Chicken (硫酸鶏) 2018-11-15 19:15:04 +09:00 committed by syuilo
parent a34fdc2068
commit 9d8f7b081d
17 changed files with 522 additions and 4 deletions

View file

@ -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 });