notherbase-fs 4.2.0 → 4.2.1

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.
@@ -31,9 +31,13 @@ export default class User {
31
31
  * @param {Object} res An Express.js response.
32
32
  */
33
33
  logout = async (req, res) => {
34
- await req.session?.destroy();
34
+ if (loginCheck(req, res)) {
35
+ delete req.user.memory?.data?.sessions[req.session.id];
36
+ await req.user.commit();
37
+ await req.session?.destroy();
35
38
 
36
- success(res, "Logged out.");
39
+ success(res, "Logged out.");
40
+ }
37
41
  }
38
42
 
39
43
  /**
package/notherbase-fs.js CHANGED
@@ -107,7 +107,7 @@ class NotherBaseFS {
107
107
  if (req.user.memory.data.sessions[req.session.id] < Date.now()) {
108
108
  req.session.regenerate(() => {});
109
109
  delete req.user.memory.data.sessions[req.session.id];
110
- await req.user.memory.save();
110
+ await req.user.commit();
111
111
  }
112
112
  }
113
113
  else req.session.regenerate(() => {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {