|
@@ -1,9 +1,9 @@
|
|
|
|
|
+import { PageDeleteConfigValue } from '~/interfaces/page-delete-config';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
|
import { removeNullPropertyFromObject } from '~/utils/object-utils';
|
|
import { removeNullPropertyFromObject } from '~/utils/object-utils';
|
|
|
|
|
+import { validateDeleteConfigs, prepareDeleteConfigValuesForCalc } from '~/utils/page-delete-config';
|
|
|
|
|
|
|
|
-import { PageDeleteConfigValue } from '~/interfaces/page-delete-config';
|
|
|
|
|
import { apiV3FormValidator } from '../../middlewares/apiv3-form-validator';
|
|
import { apiV3FormValidator } from '../../middlewares/apiv3-form-validator';
|
|
|
-import { validateDeleteConfigs, prepareDeleteConfigValuesForCalc } from '~/utils/page-delete-config';
|
|
|
|
|
|
|
|
|
|
const logger = loggerFactory('growi:routes:apiv3:security-setting');
|
|
const logger = loggerFactory('growi:routes:apiv3:security-setting');
|
|
|
|
|
|
|
@@ -12,6 +12,7 @@ const express = require('express');
|
|
|
const router = express.Router();
|
|
const router = express.Router();
|
|
|
|
|
|
|
|
const { body } = require('express-validator');
|
|
const { body } = require('express-validator');
|
|
|
|
|
+
|
|
|
const ErrorV3 = require('../../models/vo/error-apiv3');
|
|
const ErrorV3 = require('../../models/vo/error-apiv3');
|
|
|
|
|
|
|
|
const validator = {
|
|
const validator = {
|
|
@@ -461,7 +462,7 @@ module.exports = (crowi) => {
|
|
|
googleOAuth: {
|
|
googleOAuth: {
|
|
|
googleClientId: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientId'),
|
|
googleClientId: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientId'),
|
|
|
googleClientSecret: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientSecret'),
|
|
googleClientSecret: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientSecret'),
|
|
|
- isSameUsernameTreatedAsIdenticalUser: await crowi.configManager.getConfig('crowi', 'security:passport-google:isSameUsernameTreatedAsIdenticalUser'),
|
|
|
|
|
|
|
+ isSameEmailTreatedAsIdenticalUser: await crowi.configManager.getConfig('crowi', 'security:passport-google:isSameEmailTreatedAsIdenticalUser'),
|
|
|
},
|
|
},
|
|
|
githubOAuth: {
|
|
githubOAuth: {
|
|
|
githubClientId: await crowi.configManager.getConfig('crowi', 'security:passport-github:clientId'),
|
|
githubClientId: await crowi.configManager.getConfig('crowi', 'security:passport-github:clientId'),
|
|
@@ -1086,16 +1087,17 @@ module.exports = (crowi) => {
|
|
|
const requestParams = {
|
|
const requestParams = {
|
|
|
'security:passport-google:clientId': req.body.googleClientId,
|
|
'security:passport-google:clientId': req.body.googleClientId,
|
|
|
'security:passport-google:clientSecret': req.body.googleClientSecret,
|
|
'security:passport-google:clientSecret': req.body.googleClientSecret,
|
|
|
- 'security:passport-google:isSameUsernameTreatedAsIdenticalUser': req.body.isSameUsernameTreatedAsIdenticalUser,
|
|
|
|
|
|
|
+ 'security:passport-google:isSameEmailTreatedAsIdenticalUser': req.body.isSameEmailTreatedAsIdenticalUser,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
await updateAndReloadStrategySettings('google', requestParams);
|
|
await updateAndReloadStrategySettings('google', requestParams);
|
|
|
|
|
|
|
|
const securitySettingParams = {
|
|
const securitySettingParams = {
|
|
|
googleClientId: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientId'),
|
|
googleClientId: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientId'),
|
|
|
googleClientSecret: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientSecret'),
|
|
googleClientSecret: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientSecret'),
|
|
|
- isSameUsernameTreatedAsIdenticalUser: await crowi.configManager.getConfig('crowi', 'security:passport-google:isSameUsernameTreatedAsIdenticalUser'),
|
|
|
|
|
|
|
+ isSameEmailTreatedAsIdenticalUser: await crowi.configManager.getConfig('crowi', 'security:passport-google:isSameEmailTreatedAsIdenticalUser'),
|
|
|
};
|
|
};
|
|
|
return res.apiv3({ securitySettingParams });
|
|
return res.apiv3({ securitySettingParams });
|
|
|
}
|
|
}
|