WIP: Add Discord auth (#3239)
* Add Discord auth * Apply review 175263424
This commit is contained in:
parent
a34fdc2068
commit
9d8f7b081d
17 changed files with 522 additions and 4 deletions
|
@ -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 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue