@thefirstspine/auth 2.1.1 → 2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../src/auth.service.ts"],"names":[],"mappings":"AAKA,qBAAa,WAAW;IAKtB,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAkC;IAMpE,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAC,IAAI,CAAC;IAoBpC,oBAAoB,IAAI,MAAM;CAItC;;AAED,wBAAiC"}
1
+ {"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../src/auth.service.ts"],"names":[],"mappings":"AAKA,qBAAa,WAAW;IAKtB,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAkC;IAMpE,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAC,IAAI,CAAC;IA2BpC,oBAAoB,IAAI,MAAM;CAItC;;AAED,wBAAiC"}
@@ -17,16 +17,23 @@ const axios_1 = __importDefault(require("axios"));
17
17
  class AuthService {
18
18
  me(jwt) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
- const response = yield axios_1.default.get(this.getAuthNetServiceUrl() + '/api/v2/me', {
21
- headers: {
22
- Authorization: `Bearer ${jwt}`,
23
- },
24
- });
25
- const jsonResponse = response.data;
26
- if (!jsonResponse.user_id) {
20
+ try {
21
+ const response = yield axios_1.default.get(this.getAuthNetServiceUrl() + '/api/v2/me', {
22
+ headers: {
23
+ Authorization: `Bearer ${jwt}`,
24
+ },
25
+ });
26
+ const jsonResponse = response.data;
27
+ if (!jsonResponse.user_id) {
28
+ return null;
29
+ }
30
+ return jsonResponse.user_id;
31
+ }
32
+ catch (e) {
33
+ console.log({ errorFromAxios: e });
27
34
  return null;
28
35
  }
29
- return jsonResponse.user_id;
36
+ return null;
30
37
  });
31
38
  }
32
39
  getAuthNetServiceUrl() {
@@ -1 +1 @@
1
- {"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../src/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAK1B,MAAa,WAAW;IAWhB,EAAE,CAAC,GAAW;;YAElB,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,YAAY,EAAE;gBAC3E,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,GAAG,EAAE;iBAC/B;aACF,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC;YACnC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;gBACzB,OAAO,IAAI,CAAC;aACb;YAGD,OAAO,YAAY,CAAC,OAAO,CAAC;QAC9B,CAAC;KAAA;IAKM,oBAAoB;;QACzB,OAAO,CAAA,MAAA,MAAA,OAAO,CAAC,GAAG,0CAAE,QAAQ,0CAAE,MAAM,IAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IACjG,CAAC;;AAjCH,kCAmCC;AA9BiB,4BAAgB,GAAW,+BAA+B,CAAA;AAgC5E,kBAAe,IAAI,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../src/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAK1B,MAAa,WAAW;IAWhB,EAAE,CAAC,GAAW;;YAElB,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,YAAY,EAAE;oBAC3E,OAAO,EAAE;wBACP,aAAa,EAAE,UAAU,GAAG,EAAE;qBAC/B;iBACF,CAAC,CAAC;gBAEH,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC;gBACnC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;oBAC1B,OAAO,IAAI,CAAC;gBACd,CAAC;gBAGD,OAAO,YAAY,CAAC,OAAO,CAAC;YAC9B,CAAC;YAAC,OAAM,CAAC,EAAE,CAAC;gBACV,OAAO,CAAC,GAAG,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC,CAAC;gBACnC,OAAO,IAAI,CAAC;YACd,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAKM,oBAAoB;;QACzB,OAAO,CAAA,MAAA,MAAA,OAAO,CAAC,GAAG,0CAAE,QAAQ,0CAAE,MAAM,IAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IACjG,CAAC;;AAxCH,kCA0CC;AArCiB,4BAAgB,GAAW,+BAA+B,CAAA;AAuC5E,kBAAe,IAAI,WAAW,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@thefirstspine/auth",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "Javascript & Typescript dependency to help developers to use the auth net service.",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "dependencies": {
8
- "axios": "^1.5.1"
8
+ "axios": "^1.6.7"
9
9
  },
10
10
  "devDependencies": {
11
- "@types/jest": "^29.5.5",
12
- "@types/node": "^20.7.1",
13
- "@typescript-eslint/eslint-plugin": "^6.7.3",
14
- "@typescript-eslint/parser": "^6.7.3",
15
- "eslint": "^8.50.0",
11
+ "@types/jest": "^29.5.12",
12
+ "@types/node": "^20.11.17",
13
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
14
+ "@typescript-eslint/parser": "^6.21.0",
15
+ "eslint": "^8.56.0",
16
16
  "jest": "^29.7.0",
17
17
  "rimraf": "^5.0.5",
18
- "ts-jest": "^29.1.1",
19
- "ts-node": "^10.9.1",
20
- "typescript": "^5.2.2"
18
+ "ts-jest": "^29.1.2",
19
+ "ts-node": "^10.9.2",
20
+ "typescript": "^5.3.3"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "rimraf ./lib && tsc -b",