Browse Source

getConfig google security

itizawa 6 years ago
parent
commit
6c25270748
1 changed files with 17 additions and 0 deletions
  1. 17 0
      src/server/routes/apiv3/security-setting.js

+ 17 - 0
src/server/routes/apiv3/security-setting.js

@@ -79,6 +79,17 @@ const validator = {
  *              isSameUsernameTreatedAsIdenticalUser
  *              isSameUsernameTreatedAsIdenticalUser
  *                type: boolean
  *                type: boolean
  *                description: local account automatically linked the email matched
  *                description: local account automatically linked the email matched
+ *          GoogleOAuthSetting:
+ *            type:object
+ *              googleClientId:
+ *                type: string
+ *                description: key of comsumer
+ *              googleClientSecret:
+ *                type: string
+ *                description: password of comsumer
+ *              isSameUsernameTreatedAsIdenticalUser
+ *                type: boolean
+ *                description: local account automatically linked the email matched
  *          TwitterOAuthSetting:
  *          TwitterOAuthSetting:
  *            type:object
  *            type:object
  *              twitterConsumerKey:
  *              twitterConsumerKey:
@@ -119,9 +130,15 @@ module.exports = (crowi) => {
 
 
     const securityParams = {
     const securityParams = {
       generalAuth: {
       generalAuth: {
+        isGoogleOAuthEnabled: await crowi.configManager.getConfig('crowi', 'security:passport-google:isEnabled'),
         isGithubOAuthEnabled: await crowi.configManager.getConfig('crowi', 'security:passport-github:isEnabled'),
         isGithubOAuthEnabled: await crowi.configManager.getConfig('crowi', 'security:passport-github:isEnabled'),
         isTwitterOAuthEnabled: await crowi.configManager.getConfig('crowi', 'security:passport-twitter:isEnabled'),
         isTwitterOAuthEnabled: await crowi.configManager.getConfig('crowi', 'security:passport-twitter:isEnabled'),
       },
       },
+      googleOAuth: {
+        googleClientId: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientId'),
+        googleClientSecret: await crowi.configManager.getConfig('crowi', 'security:passport-google:clientSecret'),
+        isSameUsernameTreatedAsIdenticalUser: await crowi.configManager.getConfig('crowi', 'security:passport-google:isSameUsernameTreatedAsIdenticalUser'),
+      },
       githubOAuth: {
       githubOAuth: {
         githubClientId: await crowi.configManager.getConfig('crowi', 'security:passport-github:clientId'),
         githubClientId: await crowi.configManager.getConfig('crowi', 'security:passport-github:clientId'),
         githubClientSecret: await crowi.configManager.getConfig('crowi', 'security:passport-github:clientSecret'),
         githubClientSecret: await crowi.configManager.getConfig('crowi', 'security:passport-github:clientSecret'),