PromucFlow_constructor/app/client/src/ce/utils/adminSettingsHelpers.ts
Ankita Kinger 13fe125a0c
feat: Add disconnect button on auth config pages and form login callout banner (#11389)
* added form login callout banner

* form login config page changes

* form login config page changes

* added redirecturl and uneditable field components

* added disconnect button on auth pages

* Added env variables for form login auth page

* added disconnect button on auth pages

* updated docs link for dform login callout doc

* added condition for disconnect button

* added ce changes done on ee

* updated css

* suggested changes in PR review

* suggested changes in PR review

* suggested changes in PR review

* reverted gitignore files changes

* reverted gitignore files changes

* updated logic for saving admin settings

* removed unused imports

* added changes for taginput field

* removed console

* removed warning

* removed unwanted changes
2022-03-02 23:48:50 +05:30

29 lines
728 B
TypeScript

import { getAppsmithConfigs } from "@appsmith/configs";
const {
disableLoginForm,
enableGithubOAuth,
enableGoogleOAuth,
} = getAppsmithConfigs();
export const connectedMethods = [
enableGoogleOAuth,
enableGithubOAuth,
!disableLoginForm,
].filter(Boolean);
export const saveAllowed = (settings: any) => {
if (
connectedMethods.length >= 2 ||
(connectedMethods.length === 1 &&
((!("APPSMITH_FORM_LOGIN_DISABLED" in settings) && !disableLoginForm) ||
(settings["APPSMITH_OAUTH2_GOOGLE_CLIENT_ID"] !== "" &&
enableGoogleOAuth) ||
(settings["APPSMITH_OAUTH2_GITHUB_CLIENT_ID"] !== "" &&
enableGithubOAuth)))
) {
return true;
} else {
return false;
}
};