@meridianjs/auth 1.19.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -50,6 +50,7 @@ interface GoogleAuthInput {
|
|
|
50
50
|
workspace_id: string;
|
|
51
51
|
app_role_id: string | null;
|
|
52
52
|
} | null;
|
|
53
|
+
autoRegister?: boolean;
|
|
53
54
|
}
|
|
54
55
|
declare const AuthModuleService_base: new (container: MeridianContainer) => _meridianjs_types.IModuleService;
|
|
55
56
|
declare class AuthModuleService extends AuthModuleService_base {
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ interface GoogleAuthInput {
|
|
|
50
50
|
workspace_id: string;
|
|
51
51
|
app_role_id: string | null;
|
|
52
52
|
} | null;
|
|
53
|
+
autoRegister?: boolean;
|
|
53
54
|
}
|
|
54
55
|
declare const AuthModuleService_base: new (container: MeridianContainer) => _meridianjs_types.IModuleService;
|
|
55
56
|
declare class AuthModuleService extends AuthModuleService_base {
|
package/dist/index.js
CHANGED
|
@@ -179,7 +179,7 @@ var AuthModuleService = class extends (0, import_framework_utils.MeridianService
|
|
|
179
179
|
const [, userCount] = await userService.listAndCountUsers({}, { limit: 1 });
|
|
180
180
|
if (userCount === 0) {
|
|
181
181
|
role = "super-admin";
|
|
182
|
-
} else {
|
|
182
|
+
} else if (!input.autoRegister) {
|
|
183
183
|
throw Object.assign(
|
|
184
184
|
new Error("You are not authorized to access this application. Contact an admin for an invitation."),
|
|
185
185
|
{ status: 403 }
|
package/dist/index.mjs
CHANGED
|
@@ -139,7 +139,7 @@ var AuthModuleService = class extends MeridianService({}) {
|
|
|
139
139
|
const [, userCount] = await userService.listAndCountUsers({}, { limit: 1 });
|
|
140
140
|
if (userCount === 0) {
|
|
141
141
|
role = "super-admin";
|
|
142
|
-
} else {
|
|
142
|
+
} else if (!input.autoRegister) {
|
|
143
143
|
throw Object.assign(
|
|
144
144
|
new Error("You are not authorized to access this application. Contact an admin for an invitation."),
|
|
145
145
|
{ status: 403 }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meridianjs/auth",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "Meridian auth module — JWT authentication and middleware",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"prepublishOnly": "npm run build"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@meridianjs/types": "^1.
|
|
30
|
-
"@meridianjs/framework-utils": "^1.
|
|
29
|
+
"@meridianjs/types": "^1.21.0",
|
|
30
|
+
"@meridianjs/framework-utils": "^1.21.0",
|
|
31
31
|
"jsonwebtoken": "^9.0.2",
|
|
32
32
|
"bcrypt": "^5.1.1"
|
|
33
33
|
},
|