WIP: Add Discord auth (#3239)
* Add Discord auth * Apply review 175263424
This commit is contained in:
committed by
syuilo
parent
a34fdc2068
commit
9d8f7b081d
@ -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 });
|
||||
|
@ -79,6 +79,7 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
|
||||
objectStorage: config.drive && config.drive.storage === 'minio',
|
||||
twitter: instance.enableTwitterIntegration,
|
||||
github: instance.enableGithubIntegration,
|
||||
discord: instance.enableDiscordIntegration,
|
||||
serviceWorker: config.sw ? true : false,
|
||||
userRecommendation: config.user_recommendation ? config.user_recommendation : {}
|
||||
};
|
||||
@ -94,6 +95,9 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
|
||||
response.enableGithubIntegration = instance.enableGithubIntegration;
|
||||
response.githubClientId = instance.githubClientId;
|
||||
response.githubClientSecret = instance.githubClientSecret;
|
||||
response.enableDiscordIntegration = instance.enableDiscordIntegration;
|
||||
response.discordClientId = instance.discordClientId;
|
||||
response.discordClientSecret = instance.discordClientSecret;
|
||||
}
|
||||
|
||||
res(response);
|
||||
|
Reference in New Issue
Block a user