@plusscommunities/pluss-core-aws 2.0.4 → 2.0.5
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.
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const getSessionUserFromReqAuthKey = require("./auth/getSessionUserFromReqAuthKey");
|
|
2
|
+
const getUserPreview = require("./getUserPreview");
|
|
3
|
+
|
|
4
|
+
module.exports = async (req, includeType, inlcudeSite, options) => {
|
|
5
|
+
return new Promise((resolve, reject) => {
|
|
6
|
+
getSessionUserFromReqAuthKey(req)
|
|
7
|
+
.then((uid) => {
|
|
8
|
+
getUserPreview(uid, includeType, inlcudeSite, options)
|
|
9
|
+
.then((user) => {
|
|
10
|
+
resolve(user);
|
|
11
|
+
})
|
|
12
|
+
.catch((error) => {
|
|
13
|
+
console.log("failed to get user preview", uid);
|
|
14
|
+
reject(error);
|
|
15
|
+
});
|
|
16
|
+
})
|
|
17
|
+
.catch((error) => {
|
|
18
|
+
console.log("failed to get session user", authkey);
|
|
19
|
+
reject(error);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
};
|