|
|
@@ -1,7 +1,7 @@
|
|
|
-import { Container } from 'unstated';
|
|
|
-
|
|
|
import { pathUtils } from '@growi/core';
|
|
|
+import { Container } from 'unstated';
|
|
|
import urljoin from 'url-join';
|
|
|
+
|
|
|
import loggerFactory from '~/utils/logger';
|
|
|
import { removeNullPropertyFromObject } from '~/utils/object-utils';
|
|
|
|
|
|
@@ -26,7 +26,7 @@ export default class AdminGoogleSecurityContainer extends Container {
|
|
|
// set dummy value tile for using suspense
|
|
|
googleClientId: this.dummyGoogleClientId,
|
|
|
googleClientSecret: '',
|
|
|
- isSameUsernameTreatedAsIdenticalUser: false,
|
|
|
+ isSameEmailTreatedAsIdenticalUser: false,
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -42,7 +42,7 @@ export default class AdminGoogleSecurityContainer extends Container {
|
|
|
this.setState({
|
|
|
googleClientId: googleOAuth.googleClientId,
|
|
|
googleClientSecret: googleOAuth.googleClientSecret,
|
|
|
- isSameUsernameTreatedAsIdenticalUser: googleOAuth.isSameUsernameTreatedAsIdenticalUser,
|
|
|
+ isSameEmailTreatedAsIdenticalUser: googleOAuth.isSameEmailTreatedAsIdenticalUser,
|
|
|
});
|
|
|
}
|
|
|
catch (err) {
|
|
|
@@ -74,20 +74,22 @@ export default class AdminGoogleSecurityContainer extends Container {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Switch isSameUsernameTreatedAsIdenticalUser
|
|
|
+ * Switch isSameEmailTreatedAsIdenticalUser
|
|
|
*/
|
|
|
- switchIsSameUsernameTreatedAsIdenticalUser() {
|
|
|
- this.setState({ isSameUsernameTreatedAsIdenticalUser: !this.state.isSameUsernameTreatedAsIdenticalUser });
|
|
|
+ switchIsSameEmailTreatedAsIdenticalUser() {
|
|
|
+ this.setState({ isSameEmailTreatedAsIdenticalUser: !this.state.isSameEmailTreatedAsIdenticalUser });
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* Update googleSetting
|
|
|
*/
|
|
|
async updateGoogleSetting() {
|
|
|
- const { googleClientId, googleClientSecret, isSameUsernameTreatedAsIdenticalUser } = this.state;
|
|
|
+ const { googleClientId, googleClientSecret, isSameEmailTreatedAsIdenticalUser } = this.state;
|
|
|
+ console.log('updateGoogleSetting', isSameEmailTreatedAsIdenticalUser);
|
|
|
|
|
|
let requestParams = {
|
|
|
- googleClientId, googleClientSecret, isSameUsernameTreatedAsIdenticalUser,
|
|
|
+ googleClientId, googleClientSecret, isSameEmailTreatedAsIdenticalUser,
|
|
|
};
|
|
|
|
|
|
requestParams = await removeNullPropertyFromObject(requestParams);
|
|
|
@@ -97,7 +99,7 @@ export default class AdminGoogleSecurityContainer extends Container {
|
|
|
this.setState({
|
|
|
googleClientId: securitySettingParams.googleClientId,
|
|
|
googleClientSecret: securitySettingParams.googleClientSecret,
|
|
|
- isSameUsernameTreatedAsIdenticalUser: securitySettingParams.isSameUsernameTreatedAsIdenticalUser,
|
|
|
+ isSameEmailTreatedAsIdenticalUser: securitySettingParams.isSameEmailTreatedAsIdenticalUser,
|
|
|
});
|
|
|
return response;
|
|
|
}
|