@starklabs/forge 1.1.2 → 1.1.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/dist/js/app.d.ts +2 -1
- package/dist/js/app.d.ts.map +1 -1
- package/dist/js/app.js +1 -1
- package/dist/js/app.js.map +1 -1
- package/dist/js/auth/forgotPassword.d.ts +2 -2
- package/dist/js/auth/forgotPassword.d.ts.map +1 -1
- package/dist/js/auth/forgotPassword.js +6 -6
- package/dist/js/auth/forgotPassword.js.map +1 -1
- package/dist/js/auth/index.js +5 -5
- package/dist/js/auth/index.js.map +1 -1
- package/dist/js/auth/login.d.ts +2 -2
- package/dist/js/auth/login.d.ts.map +1 -1
- package/dist/js/auth/login.js +6 -6
- package/dist/js/auth/login.js.map +1 -1
- package/dist/js/auth/logout.d.ts +1 -1
- package/dist/js/auth/logout.d.ts.map +1 -1
- package/dist/js/auth/logout.js +2 -2
- package/dist/js/auth/logout.js.map +1 -1
- package/dist/js/auth/resendOTP.d.ts +2 -2
- package/dist/js/auth/resendOTP.d.ts.map +1 -1
- package/dist/js/auth/resendOTP.js +8 -8
- package/dist/js/auth/resendOTP.js.map +1 -1
- package/dist/js/auth/resetPassword.d.ts +2 -2
- package/dist/js/auth/resetPassword.d.ts.map +1 -1
- package/dist/js/auth/resetPassword.js +9 -9
- package/dist/js/auth/resetPassword.js.map +1 -1
- package/dist/js/auth/signup.d.ts +2 -2
- package/dist/js/auth/signup.d.ts.map +1 -1
- package/dist/js/auth/signup.js +8 -8
- package/dist/js/auth/signup.js.map +1 -1
- package/dist/js/auth/utils/authenticateUser.d.ts +2 -2
- package/dist/js/auth/utils/authenticateUser.d.ts.map +1 -1
- package/dist/js/auth/utils/authenticateUser.js +8 -8
- package/dist/js/auth/utils/authenticateUser.js.map +1 -1
- package/dist/js/auth/utils/createOTPModel.d.ts +1 -1
- package/dist/js/auth/utils/createOTPModel.d.ts.map +1 -1
- package/dist/js/auth/utils/createOTPModel.js +17 -8
- package/dist/js/auth/utils/createOTPModel.js.map +1 -1
- package/dist/js/auth/utils/createOTPUser.d.ts +2 -2
- package/dist/js/auth/utils/createOTPUser.d.ts.map +1 -1
- package/dist/js/auth/utils/createOTPUser.js +10 -10
- package/dist/js/auth/utils/createOTPUser.js.map +1 -1
- package/dist/js/auth/utils/createUser.d.ts +2 -2
- package/dist/js/auth/utils/createUser.d.ts.map +1 -1
- package/dist/js/auth/utils/createUser.js +7 -7
- package/dist/js/auth/utils/createUser.js.map +1 -1
- package/dist/js/auth/utils/getOTPModel.d.ts +1 -1
- package/dist/js/auth/utils/getOTPModel.d.ts.map +1 -1
- package/dist/js/auth/utils/getOTPModel.js +4 -4
- package/dist/js/auth/utils/getOTPModel.js.map +1 -1
- package/dist/js/auth/utils/getOTPUser.d.ts +2 -2
- package/dist/js/auth/utils/getOTPUser.d.ts.map +1 -1
- package/dist/js/auth/utils/getOTPUser.js +5 -5
- package/dist/js/auth/utils/getOTPUser.js.map +1 -1
- package/dist/js/auth/utils/getUser.d.ts +2 -2
- package/dist/js/auth/utils/getUser.d.ts.map +1 -1
- package/dist/js/auth/utils/getUser.js +5 -5
- package/dist/js/auth/utils/getUser.js.map +1 -1
- package/dist/js/auth/utils/handleIsVerified.d.ts +2 -2
- package/dist/js/auth/utils/handleIsVerified.d.ts.map +1 -1
- package/dist/js/auth/utils/handleIsVerified.js +3 -3
- package/dist/js/auth/utils/handleIsVerified.js.map +1 -1
- package/dist/js/auth/utils/modeMap.d.ts +8 -8
- package/dist/js/auth/utils/otpVerifiedResponse.d.ts +2 -2
- package/dist/js/auth/utils/otpVerifiedResponse.d.ts.map +1 -1
- package/dist/js/auth/utils/otpVerifiedResponse.js +4 -4
- package/dist/js/auth/utils/otpVerifiedResponse.js.map +1 -1
- package/dist/js/auth/utils/sendCookie.d.ts +4 -4
- package/dist/js/auth/utils/sendCookie.d.ts.map +1 -1
- package/dist/js/auth/utils/sendCookie.js +16 -16
- package/dist/js/auth/utils/sendCookie.js.map +1 -1
- package/dist/js/auth/utils/sendOTP.d.ts +1 -1
- package/dist/js/auth/utils/sendOTP.d.ts.map +1 -1
- package/dist/js/auth/utils/sendOTP.js +8 -8
- package/dist/js/auth/utils/sendOTP.js.map +1 -1
- package/dist/js/auth/utils/verifyCredentials.d.ts +2 -2
- package/dist/js/auth/utils/verifyCredentials.d.ts.map +1 -1
- package/dist/js/auth/utils/verifyCredentials.js +9 -9
- package/dist/js/auth/utils/verifyCredentials.js.map +1 -1
- package/dist/js/auth/verifyOTP.d.ts +2 -2
- package/dist/js/auth/verifyOTP.d.ts.map +1 -1
- package/dist/js/auth/verifyOTP.js +14 -14
- package/dist/js/auth/verifyOTP.js.map +1 -1
- package/dist/js/config/cloudinary.d.ts +1 -1
- package/dist/js/config/cloudinary.d.ts.map +1 -1
- package/dist/js/config/cloudinary.js +4 -4
- package/dist/js/config/cloudinary.js.map +1 -1
- package/dist/js/config/duration.d.ts +1 -1
- package/dist/js/config/duration.d.ts.map +1 -1
- package/dist/js/config/duration.js +4 -4
- package/dist/js/config/duration.js.map +1 -1
- package/dist/js/config/handleReqType.d.ts.map +1 -1
- package/dist/js/config/handleReqType.js +3 -1
- package/dist/js/config/handleReqType.js.map +1 -1
- package/dist/js/config/sendEmail.d.ts +2 -2
- package/dist/js/config/sendEmail.d.ts.map +1 -1
- package/dist/js/config/sendEmail.js +19 -19
- package/dist/js/config/sendEmail.js.map +1 -1
- package/dist/js/crud/create.d.ts +2 -2
- package/dist/js/crud/create.d.ts.map +1 -1
- package/dist/js/crud/create.js +11 -11
- package/dist/js/crud/create.js.map +1 -1
- package/dist/js/crud/createBulk.d.ts +2 -2
- package/dist/js/crud/createBulk.d.ts.map +1 -1
- package/dist/js/crud/createBulk.js +5 -5
- package/dist/js/crud/createBulk.js.map +1 -1
- package/dist/js/crud/handleUploads/file.add.d.ts +2 -2
- package/dist/js/crud/handleUploads/file.add.d.ts.map +1 -1
- package/dist/js/crud/handleUploads/file.add.js +12 -12
- package/dist/js/crud/handleUploads/file.add.js.map +1 -1
- package/dist/js/crud/handleUploads/file.delete.d.ts +2 -2
- package/dist/js/crud/handleUploads/file.delete.d.ts.map +1 -1
- package/dist/js/crud/handleUploads/file.delete.js +8 -8
- package/dist/js/crud/handleUploads/file.delete.js.map +1 -1
- package/dist/js/crud/handleUploads/file.update.d.ts +2 -2
- package/dist/js/crud/handleUploads/file.update.d.ts.map +1 -1
- package/dist/js/crud/handleUploads/file.update.js +8 -8
- package/dist/js/crud/handleUploads/file.update.js.map +1 -1
- package/dist/js/crud/index.d.ts.map +1 -1
- package/dist/js/crud/index.js +14 -11
- package/dist/js/crud/index.js.map +1 -1
- package/dist/js/crud/read.d.ts +2 -2
- package/dist/js/crud/read.d.ts.map +1 -1
- package/dist/js/crud/read.js +6 -6
- package/dist/js/crud/read.js.map +1 -1
- package/dist/js/crud/readAll.d.ts +2 -2
- package/dist/js/crud/readAll.d.ts.map +1 -1
- package/dist/js/crud/readAll.js +5 -5
- package/dist/js/crud/readAll.js.map +1 -1
- package/dist/js/crud/remove.d.ts +2 -2
- package/dist/js/crud/remove.d.ts.map +1 -1
- package/dist/js/crud/remove.js +6 -6
- package/dist/js/crud/remove.js.map +1 -1
- package/dist/js/crud/removeAll.d.ts +2 -2
- package/dist/js/crud/removeAll.d.ts.map +1 -1
- package/dist/js/crud/removeAll.js +5 -5
- package/dist/js/crud/removeAll.js.map +1 -1
- package/dist/js/crud/update.d.ts +2 -2
- package/dist/js/crud/update.d.ts.map +1 -1
- package/dist/js/crud/update.js +8 -8
- package/dist/js/crud/update.js.map +1 -1
- package/dist/js/crud/utils/authroizeAccess.d.ts +2 -2
- package/dist/js/crud/utils/authroizeAccess.d.ts.map +1 -1
- package/dist/js/crud/utils/authroizeAccess.js +11 -11
- package/dist/js/crud/utils/authroizeAccess.js.map +1 -1
- package/dist/js/crud/utils/getItem.d.ts +2 -2
- package/dist/js/crud/utils/getItem.d.ts.map +1 -1
- package/dist/js/crud/utils/getItem.js +9 -9
- package/dist/js/crud/utils/getItem.js.map +1 -1
- package/dist/js/crud/utils/getParam.d.ts +2 -2
- package/dist/js/crud/utils/getParam.d.ts.map +1 -1
- package/dist/js/crud/utils/getParam.js +4 -4
- package/dist/js/crud/utils/getParam.js.map +1 -1
- package/dist/js/health/health.collection.d.ts +1 -2
- package/dist/js/health/health.collection.d.ts.map +1 -1
- package/dist/js/health/health.collection.js.map +1 -1
- package/dist/js/health/index.js +2 -2
- package/dist/js/health/index.js.map +1 -1
- package/dist/js/index.d.ts +5 -3
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +5 -3
- package/dist/js/index.js.map +1 -1
- package/dist/js/lib/db.d.ts.map +1 -1
- package/dist/js/lib/db.js +10 -3
- package/dist/js/lib/db.js.map +1 -1
- package/dist/js/lib/model.factory.d.ts +1 -2
- package/dist/js/lib/model.factory.d.ts.map +1 -1
- package/dist/js/lib/model.factory.js +3 -3
- package/dist/js/lib/model.factory.js.map +1 -1
- package/dist/js/lib/mongoose.fields.d.ts.map +1 -1
- package/dist/js/lib/mongoose.fields.js +0 -1
- package/dist/js/lib/mongoose.fields.js.map +1 -1
- package/dist/js/middleware/auth.middleware.d.ts +1 -1
- package/dist/js/middleware/auth.middleware.d.ts.map +1 -1
- package/dist/js/middleware/auth.middleware.js +11 -11
- package/dist/js/middleware/auth.middleware.js.map +1 -1
- package/dist/js/middleware/multer.middleware.d.ts +1 -1
- package/dist/js/middleware/multer.middleware.d.ts.map +1 -1
- package/dist/js/middleware/multer.middleware.js +11 -11
- package/dist/js/middleware/multer.middleware.js.map +1 -1
- package/dist/js/types/Collection.d.ts +1 -2
- package/dist/js/types/Collection.d.ts.map +1 -1
- package/dist/js/types/Routepath.d.ts +1 -1
- package/dist/js/types/Routepath.d.ts.map +1 -1
- package/dist/js/upload/create.d.ts +1 -1
- package/dist/js/upload/create.d.ts.map +1 -1
- package/dist/js/upload/create.js +18 -16
- package/dist/js/upload/create.js.map +1 -1
- package/dist/js/upload/delete.d.ts +1 -1
- package/dist/js/upload/delete.d.ts.map +1 -1
- package/dist/js/upload/delete.js +28 -28
- package/dist/js/upload/delete.js.map +1 -1
- package/dist/js/upload/update.d.ts +1 -1
- package/dist/js/upload/update.d.ts.map +1 -1
- package/dist/js/upload/update.js +37 -35
- package/dist/js/upload/update.js.map +1 -1
- package/dist/js/utils/getErrorDetail.d.ts +1 -1
- package/dist/js/utils/getErrorDetail.d.ts.map +1 -1
- package/dist/js/utils/getErrorDetail.js +4 -4
- package/dist/js/utils/getErrorDetail.js.map +1 -1
- package/dist/js/utils/getModel.d.ts +3 -3
- package/dist/js/utils/getModel.d.ts.map +1 -1
- package/dist/js/utils/getModel.js +4 -4
- package/dist/js/utils/getModel.js.map +1 -1
- package/dist/js/utils/handleJWT.d.ts +4 -4
- package/dist/js/utils/handleJWT.d.ts.map +1 -1
- package/dist/js/utils/handleJWT.js +10 -10
- package/dist/js/utils/handleJWT.js.map +1 -1
- package/dist/js/utils/libsodium.d.ts +4 -4
- package/dist/js/utils/libsodium.d.ts.map +1 -1
- package/dist/js/utils/libsodium.js +17 -17
- package/dist/js/utils/libsodium.js.map +1 -1
- package/dist/js/utils/sanitize.d.ts +2 -2
- package/dist/js/utils/sanitize.d.ts.map +1 -1
- package/dist/js/utils/sanitize.js +33 -7
- package/dist/js/utils/sanitize.js.map +1 -1
- package/dist/js/utils/validate.d.ts +1 -1
- package/dist/js/utils/validate.d.ts.map +1 -1
- package/dist/js/utils/validate.js +7 -7
- package/dist/js/utils/validate.js.map +1 -1
- package/dist/js/utils/validationKeyError.d.ts +1 -1
- package/dist/js/utils/validationKeyError.d.ts.map +1 -1
- package/dist/js/utils/validationKeyError.js +6 -6
- package/dist/js/utils/validationKeyError.js.map +1 -1
- package/package.json +3 -2
- package/readme.md +6 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Response } from "express";
|
|
2
2
|
import type { Route } from "../../types/Collection.js";
|
|
3
|
-
declare const createOTPUser: ({ body, res, purpose, routeName, modelName,
|
|
3
|
+
declare const createOTPUser: ({ body, res, purpose, routeName, modelName, routeObj, }: {
|
|
4
4
|
body: any;
|
|
5
5
|
res: Response;
|
|
6
6
|
purpose: string;
|
|
7
7
|
routeName: string;
|
|
8
8
|
modelName: string;
|
|
9
|
-
|
|
9
|
+
routeObj: Route;
|
|
10
10
|
}) => Promise<void>;
|
|
11
11
|
export default createOTPUser;
|
|
12
12
|
//# sourceMappingURL=createOTPUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createOTPUser.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/createOTPUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAOxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,QAAA,MAAM,aAAa,GAAU,
|
|
1
|
+
{"version":3,"file":"createOTPUser.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/createOTPUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAOxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,QAAA,MAAM,aAAa,GAAU,yDAO1B;IACD,IAAI,EAAE,GAAG,CAAC;IACV,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC;CACjB,kBAiEA,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -5,8 +5,8 @@ import { hash } from "../../utils/libsodium.js";
|
|
|
5
5
|
import getOTPModel from "./getOTPModel.js";
|
|
6
6
|
import verifyCredentials from "./verifyCredentials.js";
|
|
7
7
|
import getErrorDetail from "../../utils/getErrorDetail.js";
|
|
8
|
-
const createOTPUser = async ({ body, res, purpose, routeName, modelName,
|
|
9
|
-
const OTPModel = getOTPModel(
|
|
8
|
+
const createOTPUser = async ({ body, res, purpose, routeName, modelName, routeObj, }) => {
|
|
9
|
+
const OTPModel = getOTPModel(routeObj);
|
|
10
10
|
if (!purpose)
|
|
11
11
|
throw new AppError({
|
|
12
12
|
message: "purpose is required.",
|
|
@@ -14,9 +14,9 @@ const createOTPUser = async ({ body, res, purpose, routeName, modelName, route,
|
|
|
14
14
|
code: "MISSING_PARAMETER",
|
|
15
15
|
hint: "Provide purpose before creating an OTP request.",
|
|
16
16
|
details: {
|
|
17
|
-
handler:
|
|
18
|
-
method:
|
|
19
|
-
path:
|
|
17
|
+
handler: routeObj.handler,
|
|
18
|
+
method: routeObj.method,
|
|
19
|
+
path: routeObj.path,
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
const existingOTPs = await OTPModel.find({ email: body.email });
|
|
@@ -27,7 +27,7 @@ const createOTPUser = async ({ body, res, purpose, routeName, modelName, route,
|
|
|
27
27
|
statusCode: 409,
|
|
28
28
|
code: "RESOURCE_ALREADY_EXISTS",
|
|
29
29
|
hint: "Check your email, including the spam folder, or request another OTP after the current one expires.",
|
|
30
|
-
details: getErrorDetail(
|
|
30
|
+
details: getErrorDetail(routeObj),
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
if (purpose === "login")
|
|
@@ -35,12 +35,12 @@ const createOTPUser = async ({ body, res, purpose, routeName, modelName, route,
|
|
|
35
35
|
modelName,
|
|
36
36
|
body,
|
|
37
37
|
routeName,
|
|
38
|
-
|
|
38
|
+
routeObj,
|
|
39
39
|
});
|
|
40
|
-
const { OTP, otpExpiry } = await sendOTP(body.email,
|
|
41
|
-
const hashedOTP = await hash(OTP,
|
|
40
|
+
const { OTP, otpExpiry } = await sendOTP(body.email, routeObj);
|
|
41
|
+
const hashedOTP = await hash(OTP, routeObj);
|
|
42
42
|
if (body?.password)
|
|
43
|
-
body.password = await hash(body.password,
|
|
43
|
+
body.password = await hash(body.password, routeObj);
|
|
44
44
|
await OTPModel.create({
|
|
45
45
|
...body,
|
|
46
46
|
OTP: hashedOTP,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createOTPUser.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/createOTPUser.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,MAAM,aAAa,GAAG,KAAK,EAAE,EAC3B,IAAI,EACJ,GAAG,EACH,OAAO,EACP,SAAS,EACT,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"createOTPUser.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/createOTPUser.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,MAAM,aAAa,GAAG,KAAK,EAAE,EAC3B,IAAI,EACJ,GAAG,EACH,OAAO,EACP,SAAS,EACT,SAAS,EACT,QAAQ,GAQT,EAAE,EAAE;IAEH,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAE,CAAC;IAGxC,IAAI,CAAC,OAAO;QACV,MAAM,IAAI,QAAQ,CAAC;YACjB,OAAO,EAAE,sBAAsB;YAC/B,UAAU,EAAE,GAAG;YACf,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,iDAAiD;YACvD,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;aACpB;SACF,CAAC,CAAC;IAGL,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAEhE,KAAK,MAAM,EAAE,IAAI,YAAY,EAAE,CAAC;QAC9B,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,KAAK,OAAO;YACnC,MAAM,IAAI,QAAQ,CAAC;gBACjB,OAAO,EAAE,iCAAiC;gBAC1C,UAAU,EAAE,GAAG;gBACf,IAAI,EAAE,yBAAyB;gBAC/B,IAAI,EAAE,oGAAoG;gBAC1G,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC;aAClC,CAAC,CAAC;IACP,CAAC;IAGD,IAAI,OAAO,KAAK,OAAO;QACrB,MAAM,iBAAiB,CAAC;YACtB,SAAS;YACT,IAAI;YACJ,SAAS;YACT,QAAQ;SACT,CAAC,CAAC;IAGL,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAE/D,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAE5C,IAAI,IAAI,EAAE,QAAQ;QAAE,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAGxE,MAAM,QAAQ,CAAC,MAAM,CAAC;QACpB,GAAG,IAAI;QACP,GAAG,EAAE,SAAS;QACd,SAAS;QACT,OAAO;KACR,CAAC,CAAC;IAGH,WAAW,CAAC;QACV,GAAG;QACH,OAAO,EAAE,wBAAwB;QACjC,UAAU,EAAE,GAAG;QACf,IAAI,EAAE;YACJ,QAAQ,EAAE,mBAAmB;SAC9B;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Response } from "express";
|
|
2
2
|
import type { Route } from "../../types/Collection.js";
|
|
3
|
-
declare const createUser: ({ body, modelName, res, routeName,
|
|
3
|
+
declare const createUser: ({ body, modelName, res, routeName, routeObj, }: {
|
|
4
4
|
body: any;
|
|
5
5
|
modelName: string;
|
|
6
6
|
res: Response;
|
|
7
7
|
routeName: string;
|
|
8
|
-
|
|
8
|
+
routeObj: Route;
|
|
9
9
|
}) => Promise<void>;
|
|
10
10
|
export default createUser;
|
|
11
11
|
//# sourceMappingURL=createUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createUser.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/createUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AASxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,UAAU,GAAU,
|
|
1
|
+
{"version":3,"file":"createUser.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/createUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AASxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,UAAU,GAAU,gDAMvB;IACD,IAAI,EAAE,GAAG,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,QAAQ,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC;CACjB,kBA0CA,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -6,16 +6,16 @@ import getModel from "../../utils/getModel.js";
|
|
|
6
6
|
import getOTPModel from "./getOTPModel.js";
|
|
7
7
|
import handleIsVerified from "./handleIsVerified.js";
|
|
8
8
|
import { sendCookie } from "./sendCookie.js";
|
|
9
|
-
const createUser = async ({ body, modelName, res, routeName,
|
|
10
|
-
const Model = getModel({ modelName, routeName,
|
|
11
|
-
const OTPModel = getOTPModel(
|
|
9
|
+
const createUser = async ({ body, modelName, res, routeName, routeObj, }) => {
|
|
10
|
+
const Model = getModel({ modelName, routeName, routeObj });
|
|
11
|
+
const OTPModel = getOTPModel(routeObj);
|
|
12
12
|
let isVerified = false;
|
|
13
13
|
let isOTPUser = null;
|
|
14
14
|
if ("isVerified" in body)
|
|
15
15
|
({ isVerified, isOTPUser } = await handleIsVerified({
|
|
16
16
|
email: body.email,
|
|
17
17
|
purpose: "signup",
|
|
18
|
-
|
|
18
|
+
routeObj
|
|
19
19
|
}));
|
|
20
20
|
if (body instanceof mongoose.Document) {
|
|
21
21
|
body = body.toObject();
|
|
@@ -23,19 +23,19 @@ const createUser = async ({ body, modelName, res, routeName, route, }) => {
|
|
|
23
23
|
delete body._id;
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
|
-
body.password = await hash(body.password,
|
|
26
|
+
body.password = await hash(body.password, routeObj);
|
|
27
27
|
body.role = "user";
|
|
28
28
|
}
|
|
29
29
|
const newUser = await Model.create(body);
|
|
30
30
|
if (isVerified)
|
|
31
31
|
await OTPModel.deleteOne({ _id: isOTPUser._id });
|
|
32
32
|
const { _id } = newUser.toObject();
|
|
33
|
-
sendCookie({ res, cookieName: "authToken", payload: { sub: _id },
|
|
33
|
+
sendCookie({ res, cookieName: "authToken", payload: { sub: _id }, routeObj });
|
|
34
34
|
appResponse({
|
|
35
35
|
res,
|
|
36
36
|
message: "Your account has been created successfully!",
|
|
37
37
|
statusCode: 201,
|
|
38
|
-
data: sanitizeOne(newUser.toObject(),
|
|
38
|
+
data: sanitizeOne(newUser.toObject(), routeObj),
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
export default createUser;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createUser.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/createUser.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,MAAM,UAAU,GAAG,KAAK,EAAE,EACxB,IAAI,EACJ,SAAS,EACT,GAAG,EACH,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"createUser.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/createUser.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,MAAM,UAAU,GAAG,KAAK,EAAE,EACxB,IAAI,EACJ,SAAS,EACT,GAAG,EACH,SAAS,EACT,QAAQ,GAOT,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IAGvC,IAAI,UAAU,GAAY,KAAK,CAAC;IAChC,IAAI,SAAS,GAAQ,IAAI,CAAC;IAC1B,IAAI,YAAY,IAAI,IAAI;QACtB,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,gBAAgB,CAAC;YAClD,KAAK,EAAE,IAAI,CAAC,KAAe;YAC3B,OAAO,EAAE,QAAQ;YACjB,QAAQ;SACT,CAAC,CAAC,CAAC;IAGN,IAAI,IAAI,YAAY,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACtC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;IACrB,CAAC;IAGD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAGzC,IAAI,UAAU;QAAE,MAAM,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC;IAEjE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAGnC,UAAU,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAG9E,WAAW,CAAC;QACV,GAAG;QACH,OAAO,EAAE,6CAA6C;QACtD,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC;KAChD,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Route } from "../../types/Collection.js";
|
|
2
|
-
declare const getOTPModel: (
|
|
2
|
+
declare const getOTPModel: (routeObj: Route) => any;
|
|
3
3
|
export default getOTPModel;
|
|
4
4
|
//# sourceMappingURL=getOTPModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOTPModel.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/getOTPModel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,WAAW,GAAI,
|
|
1
|
+
{"version":3,"file":"getOTPModel.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/getOTPModel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,WAAW,GAAI,UAAU,KAAK,QAiBnC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import registerModel from "../../lib/model.registry.js";
|
|
2
2
|
import AppError from "../../utils/AppError.js";
|
|
3
|
-
const getOTPModel = (
|
|
3
|
+
const getOTPModel = (routeObj) => {
|
|
4
4
|
const Model = registerModel["otpUser"];
|
|
5
5
|
if (!Model)
|
|
6
6
|
throw new AppError({
|
|
@@ -9,9 +9,9 @@ const getOTPModel = (route) => {
|
|
|
9
9
|
code: "CRUD_MODEL_NOT_FOUND",
|
|
10
10
|
hint: "Initialize the OTP model before using OTP authentication.",
|
|
11
11
|
details: {
|
|
12
|
-
handler:
|
|
13
|
-
method:
|
|
14
|
-
path:
|
|
12
|
+
handler: routeObj.handler,
|
|
13
|
+
method: routeObj.method,
|
|
14
|
+
path: routeObj.path,
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
17
|
return Model;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOTPModel.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/getOTPModel.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,MAAM,WAAW,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"getOTPModel.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/getOTPModel.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,MAAM,WAAW,GAAG,CAAC,QAAe,EAAE,EAAE;IACtC,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;IAEvC,IAAI,CAAC,KAAK;QACR,MAAM,IAAI,QAAQ,CAAC;YACjB,OAAO,EAAE,sBAAsB;YAC/B,UAAU,EAAE,GAAG;YACf,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,2DAA2D;YACjE,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;aACpB;SACF,CAAC,CAAC;IAEL,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Route } from "../../types/Collection.js";
|
|
2
|
-
declare const getOTPUser: ({ email, purpose,
|
|
2
|
+
declare const getOTPUser: ({ email, purpose, routeObj, }: {
|
|
3
3
|
email: string;
|
|
4
4
|
purpose: string;
|
|
5
|
-
|
|
5
|
+
routeObj: Route;
|
|
6
6
|
}) => Promise<any>;
|
|
7
7
|
export default getOTPUser;
|
|
8
8
|
//# sourceMappingURL=getOTPUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOTPUser.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/getOTPUser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,UAAU,GAAU
|
|
1
|
+
{"version":3,"file":"getOTPUser.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/getOTPUser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,UAAU,GAAU,+BAIvB;IACD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC;CACjB,iBAqBA,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import getOTPModel from "./getOTPModel.js";
|
|
2
2
|
import AppError from "../../utils/AppError.js";
|
|
3
|
-
const getOTPUser = async ({ email, purpose,
|
|
4
|
-
const OTPModel = getOTPModel(
|
|
3
|
+
const getOTPUser = async ({ email, purpose, routeObj, }) => {
|
|
4
|
+
const OTPModel = getOTPModel(routeObj);
|
|
5
5
|
const OTPUser = await OTPModel.findOne({ email, purpose });
|
|
6
6
|
if (!OTPUser)
|
|
7
7
|
throw new AppError({
|
|
@@ -10,9 +10,9 @@ const getOTPUser = async ({ email, purpose, route, }) => {
|
|
|
10
10
|
code: "CRUD_ITEM_NOT_FOUND",
|
|
11
11
|
hint: "Request a new OTP or verify the provided email and purpose.",
|
|
12
12
|
details: {
|
|
13
|
-
handler:
|
|
14
|
-
method:
|
|
15
|
-
path:
|
|
13
|
+
handler: routeObj.handler,
|
|
14
|
+
method: routeObj.method,
|
|
15
|
+
path: routeObj.path,
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
return OTPUser;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOTPUser.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/getOTPUser.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,MAAM,UAAU,GAAG,KAAK,EAAE,EACxB,KAAK,EACL,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"getOTPUser.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/getOTPUser.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,MAAM,UAAU,GAAG,KAAK,EAAE,EACxB,KAAK,EACL,OAAO,EACP,QAAQ,GAKT,EAAE,EAAE;IAEH,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IAGvC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAE3D,IAAI,CAAC,OAAO;QACV,MAAM,IAAI,QAAQ,CAAC;YACjB,OAAO,EAAE,wBAAwB;YACjC,UAAU,EAAE,GAAG;YACf,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,6DAA6D;YACnE,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;aACpB;SACF,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Route } from "../../types/Collection.js";
|
|
2
|
-
declare const getUser: ({ modelName, routeName, email, needPassword,
|
|
2
|
+
declare const getUser: ({ modelName, routeName, email, needPassword, routeObj, }: {
|
|
3
3
|
modelName: string;
|
|
4
4
|
routeName: string;
|
|
5
5
|
email: string;
|
|
6
6
|
needPassword?: boolean;
|
|
7
|
-
|
|
7
|
+
routeObj: Route;
|
|
8
8
|
}) => Promise<any>;
|
|
9
9
|
export default getUser;
|
|
10
10
|
//# sourceMappingURL=getUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUser.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/getUser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,OAAO,GAAU,
|
|
1
|
+
{"version":3,"file":"getUser.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/getUser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,OAAO,GAAU,0DAMpB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC;CACjB,iBA4BA,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import getModel from "../../utils/getModel.js";
|
|
2
2
|
import AppError from "../../utils/AppError.js";
|
|
3
|
-
const getUser = async ({ modelName, routeName, email, needPassword,
|
|
4
|
-
const Model = getModel({ modelName, routeName,
|
|
3
|
+
const getUser = async ({ modelName, routeName, email, needPassword, routeObj, }) => {
|
|
4
|
+
const Model = getModel({ modelName, routeName, routeObj });
|
|
5
5
|
let user = null;
|
|
6
6
|
if (needPassword) {
|
|
7
7
|
user = await Model.findOne({ email }).select("+password");
|
|
@@ -16,9 +16,9 @@ const getUser = async ({ modelName, routeName, email, needPassword, route, }) =>
|
|
|
16
16
|
code: "AUTH_USER_NOT_FOUND",
|
|
17
17
|
hint: "Verify the provided email address or create a new account.",
|
|
18
18
|
details: {
|
|
19
|
-
handler:
|
|
20
|
-
method:
|
|
21
|
-
path:
|
|
19
|
+
handler: routeObj.handler,
|
|
20
|
+
method: routeObj.method,
|
|
21
|
+
path: routeObj.path,
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
24
|
return user;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUser.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/getUser.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,SAAS,EACT,SAAS,EACT,KAAK,EACL,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"getUser.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/getUser.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,SAAS,EACT,SAAS,EACT,KAAK,EACL,YAAY,EACZ,QAAQ,GAOT,EAAE,EAAE;IAEH,MAAM,KAAK,GAAG,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;IAG3D,IAAI,IAAI,GAAQ,IAAI,CAAC;IAErB,IAAI,YAAY,EAAE,CAAC;QACjB,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;IAGD,IAAI,CAAC,IAAI;QACP,MAAM,IAAI,QAAQ,CAAC;YACjB,OAAO,EAAE,iBAAiB;YAC1B,UAAU,EAAE,GAAG;YACf,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,4DAA4D;YAClE,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;aACpB;SACF,CAAC,CAAC;IAEL,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Route } from "../../types/Collection.js";
|
|
2
|
-
declare const handleIsVerified: ({ email, purpose,
|
|
2
|
+
declare const handleIsVerified: ({ email, purpose, routeObj, }: {
|
|
3
3
|
email: string;
|
|
4
4
|
purpose: string;
|
|
5
|
-
|
|
5
|
+
routeObj: Route;
|
|
6
6
|
}) => Promise<{
|
|
7
7
|
isVerified: boolean;
|
|
8
8
|
isOTPUser: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleIsVerified.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/handleIsVerified.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAIvD,QAAA,MAAM,gBAAgB,GAAU
|
|
1
|
+
{"version":3,"file":"handleIsVerified.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/handleIsVerified.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAIvD,QAAA,MAAM,gBAAgB,GAAU,+BAI7B;IACD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC;CACjB;;;EAwBA,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import AppError from "../../utils/AppError.js";
|
|
2
2
|
import getOTPUser from "./getOTPUser.js";
|
|
3
3
|
import getErrorDetail from "../../utils/getErrorDetail.js";
|
|
4
|
-
const handleIsVerified = async ({ email, purpose,
|
|
4
|
+
const handleIsVerified = async ({ email, purpose, routeObj, }) => {
|
|
5
5
|
const isOTPUser = await getOTPUser({
|
|
6
6
|
email,
|
|
7
7
|
purpose,
|
|
8
|
-
|
|
8
|
+
routeObj,
|
|
9
9
|
});
|
|
10
10
|
let isVerified = false;
|
|
11
11
|
if (isOTPUser) {
|
|
@@ -18,7 +18,7 @@ const handleIsVerified = async ({ email, purpose, route, }) => {
|
|
|
18
18
|
statusCode: 403,
|
|
19
19
|
code: "AUTH_FORBIDDEN",
|
|
20
20
|
hint: "Verify your email address before continuing.",
|
|
21
|
-
details: getErrorDetail(
|
|
21
|
+
details: getErrorDetail(routeObj),
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleIsVerified.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/handleIsVerified.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAG3D,MAAM,gBAAgB,GAAG,KAAK,EAAE,EAC9B,KAAK,EACL,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"handleIsVerified.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/handleIsVerified.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAG3D,MAAM,gBAAgB,GAAG,KAAK,EAAE,EAC9B,KAAK,EACL,OAAO,EACP,QAAQ,GAKT,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC;QACjC,KAAK;QACL,OAAO;QACP,QAAQ;KACT,CAAC,CAAC;IAEH,IAAI,UAAU,GAAG,KAAK,CAAC;IAEvB,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;YACzB,UAAU,GAAG,IAAI,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,QAAQ,CAAC;gBACjB,OAAO,EAAE,gCAAgC;gBACzC,UAAU,EAAE,GAAG;gBACf,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,8CAA8C;gBACpD,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC;aAClC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
declare const modeMap: {
|
|
2
2
|
signup: {
|
|
3
|
-
otp: ({ body, res, purpose, routeName, modelName,
|
|
3
|
+
otp: ({ body, res, purpose, routeName, modelName, routeObj, }: {
|
|
4
4
|
body: any;
|
|
5
5
|
res: import("express").Response;
|
|
6
6
|
purpose: string;
|
|
7
7
|
routeName: string;
|
|
8
8
|
modelName: string;
|
|
9
|
-
|
|
9
|
+
routeObj: import("../../types/Collection.js").Route;
|
|
10
10
|
}) => Promise<void>;
|
|
11
|
-
credentials: ({ body, modelName, res, routeName,
|
|
11
|
+
credentials: ({ body, modelName, res, routeName, routeObj, }: {
|
|
12
12
|
body: any;
|
|
13
13
|
modelName: string;
|
|
14
14
|
res: import("express").Response;
|
|
15
15
|
routeName: string;
|
|
16
|
-
|
|
16
|
+
routeObj: import("../../types/Collection.js").Route;
|
|
17
17
|
}) => Promise<void>;
|
|
18
18
|
};
|
|
19
19
|
login: {
|
|
20
|
-
otp: ({ body, res, purpose, routeName, modelName,
|
|
20
|
+
otp: ({ body, res, purpose, routeName, modelName, routeObj, }: {
|
|
21
21
|
body: any;
|
|
22
22
|
res: import("express").Response;
|
|
23
23
|
purpose: string;
|
|
24
24
|
routeName: string;
|
|
25
25
|
modelName: string;
|
|
26
|
-
|
|
26
|
+
routeObj: import("../../types/Collection.js").Route;
|
|
27
27
|
}) => Promise<void>;
|
|
28
|
-
credentials: ({ body, modelName, res, routeName,
|
|
28
|
+
credentials: ({ body, modelName, res, routeName, routeObj, }: {
|
|
29
29
|
body: any;
|
|
30
30
|
modelName: string;
|
|
31
31
|
res: import("express").Response;
|
|
32
32
|
routeName: string;
|
|
33
|
-
|
|
33
|
+
routeObj: import("../../types/Collection.js").Route;
|
|
34
34
|
}) => Promise<void>;
|
|
35
35
|
};
|
|
36
36
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Response } from "express";
|
|
2
2
|
import type { Route } from "../../types/Collection.js";
|
|
3
|
-
declare const otpVerifiedResponse: ({ res, body,
|
|
3
|
+
declare const otpVerifiedResponse: ({ res, body, routeObj, }: {
|
|
4
4
|
res: Response;
|
|
5
5
|
body: any;
|
|
6
|
-
|
|
6
|
+
routeObj: Route;
|
|
7
7
|
}) => void;
|
|
8
8
|
export default otpVerifiedResponse;
|
|
9
9
|
//# sourceMappingURL=otpVerifiedResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otpVerifiedResponse.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/otpVerifiedResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,mBAAmB,GAAI,
|
|
1
|
+
{"version":3,"file":"otpVerifiedResponse.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/otpVerifiedResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,mBAAmB,GAAI,0BAI1B;IACD,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,EAAE,KAAK,CAAC;CACjB,SAkBA,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import appResponse from "../../utils/response.js";
|
|
2
2
|
import AppError from "../../utils/AppError.js";
|
|
3
|
-
const otpVerifiedResponse = ({ res, body,
|
|
3
|
+
const otpVerifiedResponse = ({ res, body, routeObj, }) => {
|
|
4
4
|
if (!body.purpose)
|
|
5
5
|
throw new AppError({
|
|
6
6
|
message: "purpose is required.",
|
|
@@ -8,9 +8,9 @@ const otpVerifiedResponse = ({ res, body, route, }) => {
|
|
|
8
8
|
code: "MISSING_PARAMETER",
|
|
9
9
|
hint: "Provide purpose before sending the OTP verification response.",
|
|
10
10
|
details: {
|
|
11
|
-
handler:
|
|
12
|
-
method:
|
|
13
|
-
path:
|
|
11
|
+
handler: routeObj.handler,
|
|
12
|
+
method: routeObj.method,
|
|
13
|
+
path: routeObj.path,
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
appResponse({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otpVerifiedResponse.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/otpVerifiedResponse.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,MAAM,mBAAmB,GAAG,CAAC,EAC3B,GAAG,EACH,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"otpVerifiedResponse.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/otpVerifiedResponse.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,MAAM,mBAAmB,GAAG,CAAC,EAC3B,GAAG,EACH,IAAI,EACJ,QAAQ,GAKT,EAAE,EAAE;IACH,IAAI,CAAC,IAAI,CAAC,OAAO;QACf,MAAM,IAAI,QAAQ,CAAC;YACjB,OAAO,EAAE,sBAAsB;YAC/B,UAAU,EAAE,GAAG;YACf,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,+DAA+D;YACrE,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;aACpB;SACF,CAAC,CAAC;IAEL,WAAW,CAAC;QACV,GAAG;QACH,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,8BAA8B;KACvD,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Response } from "express";
|
|
2
2
|
import type { Route } from "../../types/Collection.js";
|
|
3
|
-
export declare const sendCookie: ({ res, cookieName, payload,
|
|
3
|
+
export declare const sendCookie: ({ res, cookieName, payload, routeObj, }: {
|
|
4
4
|
res: Response;
|
|
5
5
|
cookieName: string;
|
|
6
6
|
payload: string | object;
|
|
7
|
-
|
|
7
|
+
routeObj: Route;
|
|
8
8
|
}) => void;
|
|
9
|
-
export declare const clearCookie: ({ res, cookieName,
|
|
9
|
+
export declare const clearCookie: ({ res, cookieName, routeObj, }: {
|
|
10
10
|
res: Response;
|
|
11
11
|
cookieName: string;
|
|
12
|
-
|
|
12
|
+
routeObj: Route;
|
|
13
13
|
}) => void;
|
|
14
14
|
//# sourceMappingURL=sendCookie.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendCookie.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/sendCookie.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,eAAO,MAAM,UAAU,GAAI,
|
|
1
|
+
{"version":3,"file":"sendCookie.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/sendCookie.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,eAAO,MAAM,UAAU,GAAI,yCAKxB;IACD,GAAG,EAAE,QAAQ,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC;CACjB,SAsCA,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,gCAIzB;IACD,GAAG,EAAE,QAAQ,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC;CACjB,SAmCA,CAAC"}
|
|
@@ -2,7 +2,7 @@ import getDuration from "../../config/duration.js";
|
|
|
2
2
|
import { getEnvs } from "../../config/envs.js";
|
|
3
3
|
import AppError from "../../utils/AppError.js";
|
|
4
4
|
import { signJWT } from "../../utils/handleJWT.js";
|
|
5
|
-
export const sendCookie = ({ res, cookieName, payload,
|
|
5
|
+
export const sendCookie = ({ res, cookieName, payload, routeObj, }) => {
|
|
6
6
|
const { tokenExpiry, ENV, domain } = getEnvs();
|
|
7
7
|
if (!tokenExpiry || !ENV)
|
|
8
8
|
throw new AppError({
|
|
@@ -11,9 +11,9 @@ export const sendCookie = ({ res, cookieName, payload, route, }) => {
|
|
|
11
11
|
code: "MISSING_ENVIRONMENT_VARIABLE",
|
|
12
12
|
hint: "Define tokenExpiry and ENV in your environment configuration.",
|
|
13
13
|
details: {
|
|
14
|
-
handler:
|
|
15
|
-
method:
|
|
16
|
-
path:
|
|
14
|
+
handler: routeObj.handler,
|
|
15
|
+
method: routeObj.method,
|
|
16
|
+
path: routeObj.path,
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
if (ENV === "production" && !domain)
|
|
@@ -23,21 +23,21 @@ export const sendCookie = ({ res, cookieName, payload, route, }) => {
|
|
|
23
23
|
code: "MISSING_ENVIRONMENT_VARIABLE",
|
|
24
24
|
hint: "Define domain when ENV is set to production.",
|
|
25
25
|
details: {
|
|
26
|
-
handler:
|
|
27
|
-
method:
|
|
28
|
-
path:
|
|
26
|
+
handler: routeObj.handler,
|
|
27
|
+
method: routeObj.method,
|
|
28
|
+
path: routeObj.path,
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
|
-
const token = signJWT({ payload,
|
|
31
|
+
const token = signJWT({ payload, routeObj });
|
|
32
32
|
res.cookie(cookieName, token, {
|
|
33
33
|
httpOnly: true,
|
|
34
|
-
maxAge: getDuration(tokenExpiry,
|
|
34
|
+
maxAge: getDuration(tokenExpiry, routeObj),
|
|
35
35
|
sameSite: ENV === "production" ? "none" : "lax",
|
|
36
36
|
secure: ENV === "production",
|
|
37
37
|
domain: ENV === "production" ? domain : undefined,
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
export const clearCookie = ({ res, cookieName,
|
|
40
|
+
export const clearCookie = ({ res, cookieName, routeObj, }) => {
|
|
41
41
|
const { ENV, domain } = getEnvs();
|
|
42
42
|
if (!ENV)
|
|
43
43
|
throw new AppError({
|
|
@@ -46,9 +46,9 @@ export const clearCookie = ({ res, cookieName, route, }) => {
|
|
|
46
46
|
code: "MISSING_ENVIRONMENT_VARIABLE",
|
|
47
47
|
hint: "Define ENV in your environment configuration.",
|
|
48
48
|
details: {
|
|
49
|
-
handler:
|
|
50
|
-
method:
|
|
51
|
-
path:
|
|
49
|
+
handler: routeObj.handler,
|
|
50
|
+
method: routeObj.method,
|
|
51
|
+
path: routeObj.path,
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
if (ENV === "production" && !domain)
|
|
@@ -58,9 +58,9 @@ export const clearCookie = ({ res, cookieName, route, }) => {
|
|
|
58
58
|
code: "MISSING_ENVIRONMENT_VARIABLE",
|
|
59
59
|
hint: "Define domain when ENV is set to production.",
|
|
60
60
|
details: {
|
|
61
|
-
handler:
|
|
62
|
-
method:
|
|
63
|
-
path:
|
|
61
|
+
handler: routeObj.handler,
|
|
62
|
+
method: routeObj.method,
|
|
63
|
+
path: routeObj.path,
|
|
64
64
|
},
|
|
65
65
|
});
|
|
66
66
|
res.clearCookie(cookieName, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendCookie.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/sendCookie.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,GAAG,EACH,UAAU,EACV,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"sendCookie.js","sourceRoot":"","sources":["../../../../src/js/auth/utils/sendCookie.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendOTP.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/sendOTP.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,OAAO,GACX,OAAO,MAAM,EACb,
|
|
1
|
+
{"version":3,"file":"sendOTP.d.ts","sourceRoot":"","sources":["../../../../src/js/auth/utils/sendOTP.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,QAAA,MAAM,OAAO,GACX,OAAO,MAAM,EACb,UAAU,KAAK,KACd,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAgD5C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|