free-be-account 0.0.30 → 0.0.32

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/index.js CHANGED
@@ -1676,7 +1676,8 @@ module.exports = (app) => ({
1676
1676
  return false;
1677
1677
  }
1678
1678
 
1679
- const refererMatched = /^\/pdfjs(_.+)?\/web\/viewer.html$/.test(refererPath) || neededReferer.split(/,|,/).map((nr) => new RegExp(nr)).some((reg) => reg.test(refererPath));
1679
+ const pdfjsReg = new RegExp(`^${app.config.frontendPublicPath || ''}\/pdfjs(_.+)?\/web\/viewer.html$`);
1680
+ const refererMatched = pdfjsReg.test(refererPath) || neededReferer.split(/,|,/).map((nr) => new RegExp(nr)).some((reg) => reg.test(refererPath));
1680
1681
 
1681
1682
  if (!refererMatched) {
1682
1683
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-be-account",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "main": "index.js",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -42,7 +42,12 @@ router.put('/', async (req, res, next) => {
42
42
  res.locals.filter = { id: user.id };
43
43
  // get new data from request (now only profile can be updated in uc)
44
44
  if (req.body.Profile) {
45
- res.locals.body = { Profile: req.body.Profile };
45
+ res.locals.body = {
46
+ Profile: {
47
+ ...user.Profile,
48
+ ...req.body.Profile,
49
+ }
50
+ };
46
51
  } else {
47
52
  res.locals.body = { Enabled: user.Enabled };
48
53
  }