pangea-server 3.3.21 → 3.3.23

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.
@@ -15,7 +15,7 @@ async function login(authHeader, db, accessToken, userCtor, extraWhere = {}) {
15
15
  const user = await db.findOneOrNull(userCtor, where, { scopes: ['withHiddenAttributes'] });
16
16
  if (!user)
17
17
  helpers_1.AppError.ThrowInvalidCredentials();
18
- const isPasswordValid = await helpers_1.Password.Compare(password, user.password);
18
+ const isPasswordValid = await helpers_1.Pass.Compare(password, user.password);
19
19
  if (!isPasswordValid)
20
20
  helpers_1.AppError.ThrowInvalidCredentials();
21
21
  return accessToken.getTokenData(userCtor, user);
@@ -4,7 +4,7 @@ export declare abstract class BaseAuth<AM extends AuthMap> {
4
4
  constructor(authUsers: AuthUsers<AM>);
5
5
  free(): void;
6
6
  notSetYet(): void;
7
- notAllowed(): void;
7
+ notAllowed(): never;
8
8
  isUserAuth<T extends UserType<AM>>(type: T): boolean;
9
9
  getUserAuth<T extends UserType<AM>>(type: T): NonNullable<AuthUsers<AM>[T]>;
10
10
  getUsersAuth<const T extends readonly UserType<AM>[]>(types: T): { [I in keyof T]: InstanceType<AM[T[I]]> | null; };
@@ -9,6 +9,6 @@ export * from './html-sanitize.helpers';
9
9
  export * from './job.helpers';
10
10
  export * from './mailer.helpers';
11
11
  export * from './multer.helpers';
12
- export * from './password.helpers';
12
+ export * from './pass.helpers';
13
13
  export * from './print.helpers';
14
14
  export * from './random.helpers';
@@ -25,6 +25,6 @@ __exportStar(require("./html-sanitize.helpers"), exports);
25
25
  __exportStar(require("./job.helpers"), exports);
26
26
  __exportStar(require("./mailer.helpers"), exports);
27
27
  __exportStar(require("./multer.helpers"), exports);
28
- __exportStar(require("./password.helpers"), exports);
28
+ __exportStar(require("./pass.helpers"), exports);
29
29
  __exportStar(require("./print.helpers"), exports);
30
30
  __exportStar(require("./random.helpers"), exports);
@@ -0,0 +1,4 @@
1
+ export declare abstract class Pass {
2
+ static Hash(data: string): Promise<string>;
3
+ static Compare(data: string, encrypted: string): Promise<boolean>;
4
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Pass = void 0;
7
+ const bcrypt_1 = __importDefault(require("bcrypt"));
8
+ class Pass {
9
+ static Hash(data) {
10
+ return bcrypt_1.default.hash(data, 10);
11
+ }
12
+ static Compare(data, encrypted) {
13
+ return bcrypt_1.default.compare(data, encrypted);
14
+ }
15
+ }
16
+ exports.Pass = Pass;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-server",
3
3
  "description": "",
4
- "version": "3.3.21",
4
+ "version": "3.3.23",
5
5
  "files": [
6
6
  "dist"
7
7
  ],