notherbase-fs 4.3.1 → 4.3.3

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.
@@ -177,7 +177,7 @@ export default class User {
177
177
  code: "",
178
178
  expires: 0
179
179
  },
180
- sessions: []
180
+ sessions: {}
181
181
  });
182
182
 
183
183
  success(res, "Registration successful!");
@@ -211,6 +211,7 @@ export default class User {
211
211
  let result = await this.validatePassword(req, req.body.password, spirit);
212
212
  if (result === "Authenticated.") {
213
213
  req.session.currentUser = req.body.username;
214
+ if (typeof spirit.memory.data.sessions !== "object" || Array.isArray(spirit.memory.data.sessions)) spirit.memory.data.sessions = {};
214
215
  spirit.memory.data.sessions[req.session.id] = Date.now() + 1000 * 60 * 60 * 24 * 28; // 28 days
215
216
  await spirit.commit();
216
217
  success(res, "Login successful!", req.body.username);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {
@@ -25,7 +25,7 @@
25
25
  <input type="password" placeholder="password" id="pass">
26
26
  </label>
27
27
  <button id="login" onclick="coverLogin()">Login</button>
28
- <a href="www.notherbase.com/the-front/keeper">Reset Password</a>
28
+ <a href="https://www.notherbase.com/the-front/keeper">Reset Password</a>
29
29
  </div>
30
30
  <p class="info"></p>
31
31