|
|
@@ -65,13 +65,11 @@ const validator = {
|
|
|
body('isSameUsernameTreatedAsIdenticalUser').isBoolean(),
|
|
|
],
|
|
|
githubOAuth: [
|
|
|
- body('isGithubOAuthEnabled').isBoolean(),
|
|
|
body('githubClientId').isString(),
|
|
|
body('githubClientSecret').isString(),
|
|
|
body('isSameUsernameTreatedAsIdenticalUser').isBoolean(),
|
|
|
],
|
|
|
twitterOAuth: [
|
|
|
- body('isTwitterOAuthEnabled').isBoolean(),
|
|
|
body('twitterConsumerKey').isString(),
|
|
|
body('twitterConsumerSecret').isString(),
|
|
|
body('isSameUsernameTreatedAsIdenticalUser').isBoolean(),
|
|
|
@@ -233,9 +231,6 @@ const validator = {
|
|
|
* description: local account automatically linked the email matched
|
|
|
* GoogleOAuthSetting:
|
|
|
* type:object
|
|
|
- * isGithubOAuthEnabled:
|
|
|
- * type: boolean
|
|
|
- * description: whether to enable github oauth
|
|
|
* googleClientId:
|
|
|
* type: string
|
|
|
* description: key of comsumer
|
|
|
@@ -246,9 +241,6 @@ const validator = {
|
|
|
* type: boolean
|
|
|
* description: local account automatically linked the email matched
|
|
|
* TwitterOAuthSetting:
|
|
|
- * isTwitterOAuthEnabled:
|
|
|
- * type: boolean
|
|
|
- * description: whether to enable twitter oauth
|
|
|
* type:object
|
|
|
* twitterConsumerKey:
|
|
|
* type: string
|
|
|
@@ -703,7 +695,6 @@ module.exports = (crowi) => {
|
|
|
*/
|
|
|
router.put('/github-oauth', loginRequiredStrictly, adminRequired, csrf, validator.githubOAuth, ApiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
|
- 'security:passport-github:isEnabled': req.body.isGithubOAuthEnabled,
|
|
|
'security:passport-github:clientId': req.body.githubClientId,
|
|
|
'security:passport-github:clientSecret': req.body.githubClientSecret,
|
|
|
'security:passport-github:isSameUsernameTreatedAsIdenticalUser': req.body.isSameUsernameTreatedAsIdenticalUser,
|
|
|
@@ -712,7 +703,6 @@ module.exports = (crowi) => {
|
|
|
try {
|
|
|
await crowi.configManager.updateConfigsInTheSameNamespace('crowi', requestParams);
|
|
|
const securitySettingParams = {
|
|
|
- isGithubOAuthEnabled: await crowi.configManager.getConfig('crowi', 'security:passport-github:isEnabled'),
|
|
|
githubClientId: await crowi.configManager.getConfig('crowi', 'security:passport-github:clientId'),
|
|
|
githubClientSecret: await crowi.configManager.getConfig('crowi', 'security:passport-github:clientSecret'),
|
|
|
isSameUsernameTreatedAsIdenticalUser: await crowi.configManager.getConfig('crowi', 'security:passport-github:isSameUsernameTreatedAsIdenticalUser'),
|
|
|
@@ -757,7 +747,6 @@ module.exports = (crowi) => {
|
|
|
*/
|
|
|
router.put('/twitter-oauth', loginRequiredStrictly, adminRequired, csrf, validator.twitterOAuth, ApiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
|
- 'security:passport-twitter:isEnabled': req.body.isTwitterOAuthEnabled,
|
|
|
'security:passport-twitter:consumerKey': req.body.twitterConsumerKey,
|
|
|
'security:passport-twitter:consumerSecret': req.body.twitterConsumerSecret,
|
|
|
'security:passport-twitter:isSameUsernameTreatedAsIdenticalUser': req.body.isSameUsernameTreatedAsIdenticalUser,
|
|
|
@@ -766,7 +755,6 @@ module.exports = (crowi) => {
|
|
|
try {
|
|
|
await crowi.configManager.updateConfigsInTheSameNamespace('crowi', requestParams);
|
|
|
const securitySettingParams = {
|
|
|
- isTwitterOAuthEnabled: await crowi.configManager.getConfig('crowi', 'security:passport-twitter:isEnabled'),
|
|
|
twitterConsumerId: await crowi.configManager.getConfig('crowi', 'security:passport-twitter:consumerKey'),
|
|
|
twitterConsumerSecret: await crowi.configManager.getConfig('crowi', 'security:passport-twitter:consumerSecret'),
|
|
|
isSameUsernameTreatedAsIdenticalUser: await crowi.configManager.getConfig('crowi', 'security:passport-twitter:isSameUsernameTreatedAsIdenticalUser'),
|