mbkauthe 1.0.2 → 1.0.3

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/index.js ADDED
@@ -0,0 +1,23 @@
1
+ import router from "./lib/main.js";
2
+ import dotenv from "dotenv";
3
+ import Joi from "joi";
4
+ dotenv.config();
5
+
6
+ const envSchema = Joi.object({
7
+ RECAPTCHA_SECRET_KEY: Joi.string().required(),
8
+ SESSION_SECRET_KEY: Joi.string().required(),
9
+ IS_DEPLOYED: Joi.string().valid("true", "false").required(),
10
+ LOGIN_DB: Joi.string().uri().required(),
11
+ MBKAUTH_TWO_FA_ENABLE: Joi.string().valid("true", "false").required(),
12
+ COOKIE_EXPIRE_TIME: Joi.number().integer().positive(),
13
+ DOMAIN: Joi.string().required(),
14
+ }).unknown(true);
15
+
16
+ const { error } = envSchema.validate(process.env);
17
+ if (error) {
18
+ throw new Error(`Environment variable validation error: ${error.message}`);
19
+ }
20
+
21
+ console.log("Hello, World!");
22
+
23
+ export default router;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mbkauthe",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "MBKTechStudio's reusable authentication system for Node.js applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/index,js DELETED
@@ -1,6 +0,0 @@
1
- import router from "./routes/main";
2
-
3
-
4
- console.log("Hello, World!");
5
-
6
- export default router;
File without changes