rlz-engine 1.0.35 → 1.0.36
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/back/rpc/rpc.d.ts +1 -1
- package/dist/back/rpc/rpc.js +1 -1
- package/package.json +1 -1
package/dist/back/rpc/rpc.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ interface RpcEndpointAnon<BodyT extends object = object, RespT extends object =
|
|
|
18
18
|
}
|
|
19
19
|
interface RpcEndpointAuth<BodyT extends object = object, RespT extends object = object, OptsT = never, UserT = never> extends RpcEndpointCommon<BodyT, RespT> {
|
|
20
20
|
readonly anonimous?: false;
|
|
21
|
-
readonly auth: (userId: string, password: string) => UserT | Promise<UserT>;
|
|
21
|
+
readonly auth: (userId: string, password: string, opts: OptsT) => UserT | Promise<UserT>;
|
|
22
22
|
readonly action: (user: UserT, body: {
|
|
23
23
|
[k in keyof BodyT]: BodyT[k];
|
|
24
24
|
}, opts: OptsT) => {
|
package/dist/back/rpc/rpc.js
CHANGED
|
@@ -28,7 +28,7 @@ function makeReg(pluginName, endpoint) {
|
|
|
28
28
|
throw httpErrors.forbidden();
|
|
29
29
|
}
|
|
30
30
|
const [userId, password] = authHeader.split(':');
|
|
31
|
-
const user = await endpoint.auth(userId, password);
|
|
31
|
+
const user = await endpoint.auth(userId, password, opts);
|
|
32
32
|
const body = req.body;
|
|
33
33
|
const respBody = await endpoint.action(user, body, opts);
|
|
34
34
|
resp.send(respBody);
|