@punks/backend-entity-manager 0.0.194 → 0.0.195
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/cjs/index.js +8 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +8 -6
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -22749,26 +22749,28 @@ let AuthenticationMiddleware = class AuthenticationMiddleware {
|
|
|
22749
22749
|
const organizationalUnits = user
|
|
22750
22750
|
? await this.getUserOrganizationalUnits(user)
|
|
22751
22751
|
: [];
|
|
22752
|
-
|
|
22752
|
+
const authData = {
|
|
22753
22753
|
user,
|
|
22754
22754
|
roles,
|
|
22755
22755
|
permissions,
|
|
22756
22756
|
organizationalUnits,
|
|
22757
22757
|
};
|
|
22758
|
-
await this.postProcessContext(
|
|
22758
|
+
req.auth = await this.postProcessContext(authData);
|
|
22759
22759
|
}
|
|
22760
22760
|
}
|
|
22761
22761
|
next();
|
|
22762
22762
|
}
|
|
22763
|
-
async postProcessContext(
|
|
22763
|
+
async postProcessContext(authData) {
|
|
22764
|
+
let processedAuth = authData;
|
|
22764
22765
|
const authenticationMiddlewares = this.getAuthenticationMiddlewares();
|
|
22765
22766
|
for (const middleware of authenticationMiddlewares) {
|
|
22766
|
-
const additionalProps = await middleware.processContext(
|
|
22767
|
-
|
|
22768
|
-
...
|
|
22767
|
+
const additionalProps = await middleware.processContext(authData);
|
|
22768
|
+
processedAuth = {
|
|
22769
|
+
...authData,
|
|
22769
22770
|
...additionalProps,
|
|
22770
22771
|
};
|
|
22771
22772
|
}
|
|
22773
|
+
return processedAuth;
|
|
22772
22774
|
}
|
|
22773
22775
|
getAuthenticationMiddlewares() {
|
|
22774
22776
|
return this.registry
|