@social-mail/social-mail-web-server 1.8.406 → 1.8.410

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.8.406",
3
+ "version": "1.8.410",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -3,7 +3,6 @@ import AuthorizationService, { ICookie } from "@entity-access/server-pages/dist/
3
3
  import SocialMailContext from "../model/SocialMailContext.js";
4
4
  import Sql from "@entity-access/entity-access/dist/sql/Sql.js";
5
5
  import { SessionUser } from "@entity-access/server-pages/dist/core/SessionUser.js";
6
- import EntityAccessError from "@entity-access/entity-access/dist/common/EntityAccessError.js";
7
6
  import BaseDiskCache from "../../common/BaseDiskCache.js";
8
7
  import { join } from "path";
9
8
  import { globalEnv } from "../../common/globalEnv.js";
@@ -36,6 +35,11 @@ export default class UserAuthorizationService extends AuthorizationService {
36
35
  return await this.loadSessionFromDb(sessionID);
37
36
  });
38
37
  user.sessionID = info.sessionID;
38
+ if (!info.userID) {
39
+ // delete cache. cache is invalid...
40
+ await this.diskCache.deleteAt(keyPath);
41
+ return;
42
+ }
39
43
  user.userID = info.userID;
40
44
  user.roles = info.roles;
41
45
  user.expiry = info.expiry;
@@ -72,7 +76,7 @@ export default class UserAuthorizationService extends AuthorizationService {
72
76
  ])
73
77
  .first();
74
78
  if (!session?.user) {
75
- throw new EntityAccessError(`Session not found`);
79
+ return { sessionID };
76
80
  }
77
81
 
78
82
  // extend session...