@things-factory/auth-base 10.1.33 → 10.1.34

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/auth-base",
3
- "version": "10.1.33",
3
+ "version": "10.1.34",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -34,9 +34,9 @@
34
34
  "@reduxjs/toolkit": "^2.2.5",
35
35
  "@simplewebauthn/browser": "^13.0.0",
36
36
  "@simplewebauthn/server": "^13.0.0",
37
- "@things-factory/email-base": "^10.1.33",
37
+ "@things-factory/email-base": "^10.1.34",
38
38
  "@things-factory/env": "^10.1.20",
39
- "@things-factory/shell": "^10.1.33",
39
+ "@things-factory/shell": "^10.1.34",
40
40
  "@things-factory/utils": "^10.1.20",
41
41
  "@types/webappsec-credential-management": "^0.6.9",
42
42
  "jsonwebtoken": "^9.0.0",
@@ -48,5 +48,5 @@
48
48
  "passport-jwt": "^4.0.0",
49
49
  "passport-local": "^1.0.0"
50
50
  },
51
- "gitHead": "7fb7b6587846b5ff6ee7a4983652d9561b4d6b2c"
51
+ "gitHead": "5e16fd9f0cbb71c8d395b58a95bd9e99c93975c7"
52
52
  }
@@ -1,4 +0,0 @@
1
- export declare function checkin({ userId, subdomain }: {
2
- userId: any;
3
- subdomain: any;
4
- }): Promise<string | false>;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkin = checkin;
4
- const shell_1 = require("@things-factory/shell");
5
- const user_js_1 = require("../service/user/user.js");
6
- const get_user_domains_js_1 = require("../utils/get-user-domains.js");
7
- async function checkin({ userId, subdomain }) {
8
- const userRepo = (0, shell_1.getRepository)(user_js_1.User);
9
- const user = await userRepo.findOne({ where: { id: userId } });
10
- const domains = await (0, get_user_domains_js_1.getUserDomains)(user);
11
- if (!domains?.length) {
12
- return false;
13
- }
14
- const domain = domains.find(domain => domain.subdomain == subdomain);
15
- if (!domain) {
16
- return false;
17
- }
18
- return await user.sign({ subdomain });
19
- }
20
- //# sourceMappingURL=checkin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkin.js","sourceRoot":"","sources":["../../server/controllers/checkin.ts"],"names":[],"mappings":";;AAKA,0BAeC;AApBD,iDAA6D;AAE7D,qDAA8C;AAC9C,sEAA6D;AAEtD,KAAK,UAAU,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE;IACjD,MAAM,QAAQ,GAAG,IAAA,qBAAa,EAAC,cAAI,CAAC,CAAA;IACpC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;IAC9D,MAAM,OAAO,GAAsB,MAAM,IAAA,oCAAc,EAAC,IAAI,CAAC,CAAA;IAE7D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,CAAA;IACpE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;AACvC,CAAC","sourcesContent":["import { Domain, getRepository } from '@things-factory/shell'\n\nimport { User } from '../service/user/user.js'\nimport { getUserDomains } from '../utils/get-user-domains.js'\n\nexport async function checkin({ userId, subdomain }) {\n const userRepo = getRepository(User)\n const user = await userRepo.findOne({ where: { id: userId } })\n const domains: Partial<Domain>[] = await getUserDomains(user)\n\n if (!domains?.length) {\n return false\n }\n\n const domain = domains.find(domain => domain.subdomain == subdomain)\n if (!domain) {\n return false\n }\n\n return await user.sign({ subdomain })\n}\n"]}