@openinc/parse-server-opendash 3.29.9 → 3.29.10

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.
@@ -39,8 +39,8 @@ function getKey(header, callback) {
39
39
  * @param accessToken The access token to authenticate the request.
40
40
  * @returns The email address of the user.
41
41
  */
42
- async function getUserMail(accessToken) {
43
- const response = await fetch("https://graph.microsoft.com/v1.0/me", {
42
+ async function getUserMail(accessToken, userid) {
43
+ const response = await fetch(`https://graph.microsoft.com/v1.0/users/${userid}`, {
44
44
  method: "GET",
45
45
  headers: {
46
46
  Authorization: `Bearer ${accessToken}`,
@@ -102,7 +102,10 @@ async function init(name) {
102
102
  resolve(decoded);
103
103
  });
104
104
  });
105
- const usermail = await getUserMail(request.params.accessToken);
105
+ let usermail = null;
106
+ if (verifiedPayload.oid) {
107
+ usermail = await getUserMail(token, verifiedPayload.oid);
108
+ }
106
109
  const defaultTenant = await new Parse.Query(types_1.Tenant)
107
110
  .ascending("createdAt")
108
111
  .first({ useMasterKey: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openinc/parse-server-opendash",
3
- "version": "3.29.9",
3
+ "version": "3.29.10",
4
4
  "description": "Parse Server Cloud Code for open.INC Stack.",
5
5
  "packageManager": "pnpm@10.20.0",
6
6
  "keywords": [