diff --git a/packages/nc-gui/components/admin/SignupSettings.vue b/packages/nc-gui/components/admin/SignupSettings.vue
index 6308a113c0..c1186ed348 100644
--- a/packages/nc-gui/components/admin/SignupSettings.vue
+++ b/packages/nc-gui/components/admin/SignupSettings.vue
@@ -4,7 +4,7 @@ import { extractSdkResponseErrorMsg, useApi } from '#imports'
const { api } = useApi()
-let settings = $ref({ enable_user_signup: false })
+let settings = $ref({ disable_user_signup: false })
const loadSettings = async () => {
try {
@@ -33,8 +33,8 @@ loadSettings()
Settings
- Enable user signupDisable user signup
diff --git a/packages/nocodb/src/lib/meta/api/ee/index.ts b/packages/nocodb/src/lib/meta/api/ee/index.ts
new file mode 100644
index 0000000000..9ceea1f3fd
--- /dev/null
+++ b/packages/nocodb/src/lib/meta/api/ee/index.ts
@@ -0,0 +1,18 @@
+import { Router } from 'express';
+import { LICENSE_KEY } from '../../../constants';
+import Store from '../../../models/Store';
+
+export const validateEE = async (_req, res, next) => {
+ const key = await Store.get(LICENSE_KEY);
+ if (!key?.value) {
+ return res.status(403).json({ msg: 'Not available' });
+ }
+ next();
+};
+
+const router = Router({ mergeParams: true });
+
+// verify key
+// router.use((_req, _res, next) => {});
+
+export default router;
diff --git a/packages/nocodb/src/lib/meta/api/orgUserApis.ts b/packages/nocodb/src/lib/meta/api/orgUserApis.ts
index 6498d54001..09d1972e58 100644
--- a/packages/nocodb/src/lib/meta/api/orgUserApis.ts
+++ b/packages/nocodb/src/lib/meta/api/orgUserApis.ts
@@ -243,7 +243,7 @@ async function appSettingsSet(req, res) {
key: NC_APP_SETTINGS,
});
- res.json({ msg: 'License key saved' });
+ res.json({ msg: 'Settings saved' });
}
const router = Router({ mergeParams: true });
diff --git a/packages/nocodb/src/lib/meta/api/userApi/userApis.ts b/packages/nocodb/src/lib/meta/api/userApi/userApis.ts
index 687cb4d137..f0578cee3a 100644
--- a/packages/nocodb/src/lib/meta/api/userApi/userApis.ts
+++ b/packages/nocodb/src/lib/meta/api/userApi/userApis.ts
@@ -1,8 +1,11 @@
import { Request, Response } from 'express';
import { TableType, validatePassword } from 'nocodb-sdk';
import { OrgUserRoles } from '../../../../enums/OrgUserRoles';
+import { NC_APP_SETTINGS } from '../../../constants';
+import Store from '../../../models/Store';
import { Tele } from '../../../utils/Tele';
import catchError, { NcError } from '../../helpers/catchError';
+
const { isEmail } = require('validator');
import * as ejs from 'ejs';
@@ -96,7 +99,12 @@ export async function signup(req: Request, res: Response) {
count: 1,
});
} else {
- if (process.env.NC_INVITE_ONLY_SIGNUP) {
+ let settings: { disable_user_signup?: boolean } = {};
+ try {
+ settings = JSON.parse((await Store.get(NC_APP_SETTINGS))?.value);
+ } catch {}
+
+ if (process.env.NC_INVITE_ONLY_SIGNUP || settings?.disable_user_signup) {
NcError.badRequest('Not allowed to signup, contact super admin.');
} else {
roles = OrgUserRoles.VIEWER;
diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json
index 3902e3d78a..7ebee3f7e8 100644
--- a/scripts/sdk/swagger.json
+++ b/scripts/sdk/swagger.json
@@ -584,7 +584,7 @@
"schema": {
"type": "object",
"properties": {
- "enable_user_signup": {
+ "disable_user_signup": {
"type": "boolean"
}
}
@@ -613,7 +613,7 @@
"schema": {
"type": "object",
"properties": {
- "enable_user_signup": {
+ "disable_user_signup": {
"type": "boolean"
}
}