@feathersjs/authentication-client 5.0.0-pre.2 → 5.0.0-pre.20

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/CHANGELOG.md CHANGED
@@ -3,6 +3,173 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507))
12
+
13
+
14
+
15
+
16
+
17
+ # [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01)
18
+
19
+ **Note:** Version bump only for package @feathersjs/authentication-client
20
+
21
+
22
+
23
+
24
+
25
+ # [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11)
26
+
27
+ **Note:** Version bump only for package @feathersjs/authentication-client
28
+
29
+
30
+
31
+
32
+
33
+ # [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15)
34
+
35
+ **Note:** Version bump only for package @feathersjs/authentication-client
36
+
37
+
38
+
39
+
40
+
41
+ # [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12)
42
+
43
+ **Note:** Version bump only for package @feathersjs/authentication-client
44
+
45
+
46
+
47
+
48
+
49
+ # [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110))
55
+
56
+
57
+
58
+
59
+
60
+ # [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13)
61
+
62
+ **Note:** Version bump only for package @feathersjs/authentication-client
63
+
64
+
65
+
66
+
67
+
68
+ # [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13)
69
+
70
+ **Note:** Version bump only for package @feathersjs/authentication-client
71
+
72
+
73
+
74
+
75
+
76
+ # [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12)
77
+
78
+ **Note:** Version bump only for package @feathersjs/authentication-client
79
+
80
+
81
+
82
+
83
+
84
+ # [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06)
85
+
86
+ **Note:** Version bump only for package @feathersjs/authentication-client
87
+
88
+
89
+
90
+
91
+
92
+ # [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19)
93
+
94
+ **Note:** Version bump only for package @feathersjs/authentication-client
95
+
96
+
97
+
98
+
99
+
100
+ # [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09)
101
+
102
+ **Note:** Version bump only for package @feathersjs/authentication-client
103
+
104
+
105
+
106
+
107
+
108
+ # [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09)
109
+
110
+ **Note:** Version bump only for package @feathersjs/authentication-client
111
+
112
+
113
+
114
+
115
+
116
+ # [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09)
117
+
118
+ **Note:** Version bump only for package @feathersjs/authentication-client
119
+
120
+
121
+
122
+
123
+
124
+ # [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08)
125
+
126
+ **Note:** Version bump only for package @feathersjs/authentication-client
127
+
128
+
129
+
130
+
131
+
132
+ # [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23)
133
+
134
+
135
+ ### Bug Fixes
136
+
137
+ * **hooks:** Migrate built-in hooks and allow backwards compatibility ([#2358](https://github.com/feathersjs/feathers/issues/2358)) ([759c5a1](https://github.com/feathersjs/feathers/commit/759c5a19327a731af965c3604119393b3d09a406))
138
+ * **koa:** Use extended query parser for compatibility ([#2397](https://github.com/feathersjs/feathers/issues/2397)) ([b2944ba](https://github.com/feathersjs/feathers/commit/b2944bac3ec6d5ecc80dc518cd4e58093692db74))
139
+
140
+
141
+ ### Features
142
+
143
+ * **adapter-commons:** Add support for params.adapter option and move memory adapter to @feathersjs/memory ([#2367](https://github.com/feathersjs/feathers/issues/2367)) ([a43e7da](https://github.com/feathersjs/feathers/commit/a43e7da22b6b981a96d1321736ea9a0cb924fb4f))
144
+
145
+
146
+
147
+
148
+
149
+ # [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13)
150
+
151
+ **Note:** Version bump only for package @feathersjs/authentication-client
152
+
153
+
154
+
155
+
156
+
157
+ # [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21)
158
+
159
+
160
+ ### Bug Fixes
161
+
162
+ * **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897))
163
+
164
+
165
+ ### Features
166
+
167
+ * **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a))
168
+
169
+
170
+
171
+
172
+
6
173
  # [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06)
7
174
 
8
175
  **Note:** Version bump only for package @feathersjs/authentication-client
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Feathers
3
+ Copyright (c) 2022 Feathers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @feathersjs/authentication-client
2
2
 
3
3
  [![CI](https://github.com/feathersjs/feathers/workflows/CI/badge.svg)](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI)
4
- [![Dependency Status](https://img.shields.io/david/feathersjs/feathers.svg?style=flat-square&path=packages/authentication-client)](https://david-dm.org/feathersjs/feathers?path=packages/authentication-client)
5
4
  [![Download Status](https://img.shields.io/npm/dm/@feathersjs/authentication-client.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/authentication-client)
5
+ [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/qa8kez8QBx)
6
6
 
7
7
  > Feathers authentication client
8
8
 
@@ -18,6 +18,6 @@ Refer to the [Feathers authentication client API documentation](https://docs.fea
18
18
 
19
19
  ## License
20
20
 
21
- Copyright (c) 2021 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
21
+ Copyright (c) 2022 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
22
22
 
23
23
  Licensed under the [MIT license](LICENSE).
package/lib/core.d.ts CHANGED
@@ -19,7 +19,7 @@ export declare class AuthenticationClient {
19
19
  authenticated: boolean;
20
20
  options: AuthenticationClientOptions;
21
21
  constructor(app: Application, options: AuthenticationClientOptions);
22
- get service(): import("@feathersjs/feathers").FeathersService<Application<any, any>, import("@feathersjs/feathers").Service<any, Partial<any>>>;
22
+ get service(): import("@feathersjs/feathers").FeathersService<Application<any, any>, import("@feathersjs/feathers").Service<any, Partial<any>, Params<import("@feathersjs/feathers").Query>>>;
23
23
  get storage(): Storage;
24
24
  handleSocket(socket: any): void;
25
25
  getFromLocation(location: Location): Promise<any>;
@@ -1,2 +1,2 @@
1
- import { HookContext } from '@feathersjs/feathers';
2
- export declare const authentication: () => (context: HookContext) => HookContext<import("@feathersjs/feathers").Application<any, any>, any> | Promise<HookContext<import("@feathersjs/feathers").Application<any, any>, any>>;
1
+ import { HookContext, NextFunction } from '@feathersjs/feathers';
2
+ export declare const authentication: () => (context: HookContext, next: NextFunction) => Promise<any>;
@@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.authentication = void 0;
4
4
  const commons_1 = require("@feathersjs/commons");
5
5
  const authentication = () => {
6
- return (context) => {
6
+ return (context, next) => {
7
7
  const { app, params, path, method, app: { authentication: service } } = context;
8
- if (commons_1.stripSlashes(service.options.path) === path && method === 'create') {
9
- return context;
8
+ if ((0, commons_1.stripSlashes)(service.options.path) === path && method === 'create') {
9
+ return next();
10
10
  }
11
11
  return Promise.resolve(app.get('authentication')).then(authResult => {
12
12
  if (authResult) {
13
13
  context.params = Object.assign({}, authResult, params);
14
14
  }
15
- return context;
16
- });
15
+ }).then(next);
17
16
  };
18
17
  };
19
18
  exports.authentication = authentication;
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../src/hooks/authentication.ts"],"names":[],"mappings":";;;AACA,iDAAmD;AAE5C,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CAAC,OAAoB,EAAE,EAAE;QAC9B,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,GAAG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AC,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,cAAc,kBAczB"}
@@ -1,2 +1,2 @@
1
- import { HookContext } from '@feathersjs/feathers';
2
- export declare const populateHeader: () => (context: HookContext) => HookContext<import("@feathersjs/feathers").Application<any, any>, any>;
1
+ import { HookContext, NextFunction } from '@feathersjs/feathers';
2
+ export declare const populateHeader: () => (context: HookContext, next: NextFunction) => Promise<any>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.populateHeader = void 0;
4
4
  const populateHeader = () => {
5
- return (context) => {
5
+ return (context, next) => {
6
6
  const { app, params: { accessToken } } = context;
7
7
  const authentication = app.authentication;
8
8
  // Set REST header if necessary
@@ -13,7 +13,7 @@ const populateHeader = () => {
13
13
  [header]: authHeader
14
14
  }, context.params.headers);
15
15
  }
16
- return context;
16
+ return next();
17
17
  };
18
18
  };
19
19
  exports.populateHeader = populateHeader;
@@ -1 +1 @@
1
- {"version":3,"file":"populate-header.js","sourceRoot":"","sources":["../../src/hooks/populate-header.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CAAC,OAAoB,EAAE,EAAE;QAC9B,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC;QACjD,MAAM,cAAc,GAAG,GAAG,CAAC,cAAc,CAAC;QAE1C,+BAA+B;QAC/B,IAAI,GAAG,CAAC,IAAI,IAAI,WAAW,EAAE;YAC3B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC;YAClD,MAAM,UAAU,GAAG,GAAG,MAAM,IAAI,WAAW,EAAE,CAAC;YAE9C,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;gBACzC,CAAC,MAAM,CAAC,EAAE,UAAU;aACrB,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SAC5B;QAED,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,cAAc,kBAiBzB"}
1
+ {"version":3,"file":"populate-header.js","sourceRoot":"","sources":["../../src/hooks/populate-header.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CAAC,OAAoB,EAAE,IAAkB,EAAE,EAAE;QAClD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC;QACjD,MAAM,cAAc,GAAG,GAAG,CAAC,cAAc,CAAC;QAE1C,+BAA+B;QAC/B,IAAI,GAAG,CAAC,IAAI,IAAI,WAAW,EAAE;YAC3B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC;YAClD,MAAM,UAAU,GAAG,GAAG,MAAM,IAAI,WAAW,EAAE,CAAC;YAE9C,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;gBACzC,CAAC,MAAM,CAAC,EAAE,UAAU;aACrB,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SAC5B;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,cAAc,kBAiBzB"}
package/lib/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as hooks from './hooks';
3
3
  import { Application } from '@feathersjs/feathers';
4
4
  import { Storage, MemoryStorage, StorageWrapper } from './storage';
5
5
  declare module '@feathersjs/feathers/lib/declarations' {
6
- interface Application<ServiceTypes, AppSettings> {
6
+ interface Application<Services, Settings> {
7
7
  io?: any;
8
8
  rest?: any;
9
9
  authentication: AuthenticationClient;
package/lib/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -34,7 +38,7 @@ const getDefaultStorage = () => {
34
38
  return new storage_1.MemoryStorage();
35
39
  };
36
40
  exports.getDefaultStorage = getDefaultStorage;
37
- exports.defaultStorage = exports.getDefaultStorage();
41
+ exports.defaultStorage = (0, exports.getDefaultStorage)();
38
42
  exports.defaults = {
39
43
  header: 'Authorization',
40
44
  scheme: 'Bearer',
@@ -55,14 +59,10 @@ const init = (_options = {}) => {
55
59
  app.authenticate = authentication.authenticate.bind(authentication);
56
60
  app.reAuthenticate = authentication.reAuthenticate.bind(authentication);
57
61
  app.logout = authentication.logout.bind(authentication);
58
- app.hooks({
59
- before: {
60
- all: [
61
- hooks.authentication(),
62
- hooks.populateHeader()
63
- ]
64
- }
65
- });
62
+ app.hooks([
63
+ hooks.authentication(),
64
+ hooks.populateHeader()
65
+ ]);
66
66
  };
67
67
  };
68
68
  exports.default = init;
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA2E;AAwBlE,qGAxBA,2BAAoB,OAwBA;AAvB7B,+CAAiC;AAuBmD,sBAAK;AArBzF,uCAAmE;AAqBE,8FArBnD,uBAAa,OAqBmD;AAR3E,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,IAAI;QACF,OAAO,IAAI,wBAAc,CAAC,MAAM,CAAC,YAAY,CA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AG,EAAE,OAAO,CAAC,CAAC;QAExD,GAAG,CAAC,cAAc,GAAG,cAAc,CAAC;QACpC,GAAG,CAAC,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACpE,GAAG,CAAC,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACxE,GAAG,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAExD,GAAG,CAAC,KAAK,CAAC;YACR,KAAK,CAAC,cAAc,EAAE;YACtB,KAAK,CAAC,cAAc,EAAE;SACvB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC;AAEpB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACtD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@feathersjs/authentication-client",
3
3
  "description": "The authentication plugin for feathers-client",
4
- "version": "5.0.0-pre.2",
4
+ "version": "5.0.0-pre.20",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/",
7
7
  "types": "lib/",
@@ -16,7 +16,8 @@
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git://github.com/feathersjs/feathers.git"
19
+ "url": "git://github.com/feathersjs/feathers.git",
20
+ "directory": "packages/authentication-client"
20
21
  },
21
22
  "author": {
22
23
  "name": "Feathers contributors",
@@ -42,8 +43,7 @@
42
43
  "scripts": {
43
44
  "prepublish": "npm run compile",
44
45
  "compile": "shx rm -rf lib/ && tsc",
45
- "test": "npm run compile && npm run mocha",
46
- "mocha": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
46
+ "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
47
47
  },
48
48
  "directories": {
49
49
  "lib": "lib"
@@ -52,27 +52,25 @@
52
52
  "access": "public"
53
53
  },
54
54
  "dependencies": {
55
- "@feathersjs/authentication": "^5.0.0-pre.2",
56
- "@feathersjs/commons": "^5.0.0-pre.2",
57
- "@feathersjs/errors": "^5.0.0-pre.2",
58
- "@feathersjs/feathers": "^5.0.0-pre.2",
59
- "debug": "^4.3.1"
55
+ "@feathersjs/authentication": "^5.0.0-pre.20",
56
+ "@feathersjs/commons": "^5.0.0-pre.20",
57
+ "@feathersjs/errors": "^5.0.0-pre.20",
58
+ "@feathersjs/feathers": "^5.0.0-pre.20"
60
59
  },
61
60
  "devDependencies": {
62
- "@feathersjs/adapter-memory": "^5.0.0-pre.2",
63
- "@feathersjs/authentication-local": "^5.0.0-pre.2",
64
- "@feathersjs/express": "^5.0.0-pre.2",
65
- "@feathersjs/rest-client": "^5.0.0-pre.2",
66
- "@feathersjs/socketio": "^5.0.0-pre.2",
67
- "@feathersjs/socketio-client": "^5.0.0-pre.2",
68
- "@types/debug": "^4.1.5",
69
- "@types/mocha": "^8.2.2",
70
- "@types/node": "^14.14.37",
71
- "axios": "^0.21.1",
72
- "mocha": "^8.3.2",
73
- "shx": "^0.3.3",
74
- "ts-node": "^9.1.1",
75
- "typescript": "^4.2.3"
61
+ "@feathersjs/authentication-local": "^5.0.0-pre.20",
62
+ "@feathersjs/express": "^5.0.0-pre.20",
63
+ "@feathersjs/memory": "^5.0.0-pre.20",
64
+ "@feathersjs/rest-client": "^5.0.0-pre.20",
65
+ "@feathersjs/socketio": "^5.0.0-pre.20",
66
+ "@feathersjs/socketio-client": "^5.0.0-pre.20",
67
+ "@types/mocha": "^9.1.1",
68
+ "@types/node": "^17.0.31",
69
+ "axios": "^0.27.2",
70
+ "mocha": "^10.0.0",
71
+ "shx": "^0.3.4",
72
+ "ts-node": "^10.7.0",
73
+ "typescript": "^4.6.4"
76
74
  },
77
- "gitHead": "6e1f888dc5b612d2d77653177622e3f66245a0fb"
75
+ "gitHead": "54de749a0b392c7da726c668002b50cafaca530c"
78
76
  }
@@ -1,20 +1,18 @@
1
- import { HookContext } from '@feathersjs/feathers';
1
+ import { HookContext, NextFunction } from '@feathersjs/feathers';
2
2
  import { stripSlashes } from '@feathersjs/commons';
3
3
 
4
4
  export const authentication = () => {
5
- return (context: HookContext) => {
5
+ return (context: HookContext, next: NextFunction) => {
6
6
  const { app, params, path, method, app: { authentication: service } } = context;
7
7
 
8
8
  if (stripSlashes(service.options.path) === path && method === 'create') {
9
- return context;
9
+ return next();
10
10
  }
11
11
 
12
12
  return Promise.resolve(app.get('authentication')).then(authResult => {
13
13
  if (authResult) {
14
14
  context.params = Object.assign({}, authResult, params);
15
15
  }
16
-
17
- return context;
18
- });
16
+ }).then(next);
19
17
  };
20
18
  };
@@ -1,7 +1,7 @@
1
- import { HookContext } from '@feathersjs/feathers';
1
+ import { HookContext, NextFunction } from '@feathersjs/feathers';
2
2
 
3
3
  export const populateHeader = () => {
4
- return (context: HookContext) => {
4
+ return (context: HookContext, next: NextFunction) => {
5
5
  const { app, params: { accessToken } } = context;
6
6
  const authentication = app.authentication;
7
7
 
@@ -15,6 +15,6 @@ export const populateHeader = () => {
15
15
  }, context.params.headers);
16
16
  }
17
17
 
18
- return context;
18
+ return next();
19
19
  };
20
20
  };
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@ import { Application } from '@feathersjs/feathers';
4
4
  import { Storage, MemoryStorage, StorageWrapper } from './storage';
5
5
 
6
6
  declare module '@feathersjs/feathers/lib/declarations' {
7
- interface Application<ServiceTypes, AppSettings> { // eslint-disable-line
7
+ interface Application<Services, Settings> { // eslint-disable-line
8
8
  io?: any;
9
9
  rest?: any;
10
10
  authentication: AuthenticationClient;
@@ -17,7 +17,7 @@ declare module '@feathersjs/feathers/lib/declarations' {
17
17
  export const getDefaultStorage = () => {
18
18
  try {
19
19
  return new StorageWrapper(window.localStorage);
20
- } catch (error) {}
20
+ } catch (error: any) {}
21
21
 
22
22
  return new MemoryStorage();
23
23
  };
@@ -52,14 +52,10 @@ const init = (_options: Partial<AuthenticationClientOptions> = {}) => {
52
52
  app.reAuthenticate = authentication.reAuthenticate.bind(authentication);
53
53
  app.logout = authentication.logout.bind(authentication);
54
54
 
55
- app.hooks({
56
- before: {
57
- all: [
58
- hooks.authentication(),
59
- hooks.populateHeader()
60
- ]
61
- }
62
- });
55
+ app.hooks([
56
+ hooks.authentication(),
57
+ hooks.populateHeader()
58
+ ]);
63
59
  };
64
60
  };
65
61