notherbase-fs 3.3.6 → 3.3.7

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.
@@ -70,7 +70,7 @@ export default class Creation {
70
70
  let user = await req.db.User.recallOne(req.session.currentUser);
71
71
  if (user) {
72
72
  context.userID = user.id;
73
- context.user = user.context;
73
+ context.user = user.data;
74
74
  };
75
75
 
76
76
  res.render(req.toRender, context);
package/models/user.js CHANGED
@@ -36,8 +36,8 @@ export default class User extends Spirit {
36
36
  if (found) {
37
37
  user.memory = found;
38
38
  user.id = found._id;
39
- user.context = found.data.backups[0].data;
40
- user.email = user.context.email;
39
+ user.data = found.data.backups[0].data;
40
+ user.email = user.data.email;
41
41
 
42
42
  return user;
43
43
  }
@@ -61,25 +61,30 @@ export default class User extends Spirit {
61
61
  service: "user",
62
62
  parent: null,
63
63
  _lastUpdate: Date.now(),
64
- data: {
65
- username: username,
66
- password: hash,
67
- email: email,
68
- resetToken: null,
69
- resetExp: null,
70
- coin: 0,
71
- home: "/",
72
- authLevels: [ "Basic" ],
73
- location: "/the-front",
74
- attributes: {
75
- translation: 0,
76
- strength: 0,
77
- agility: 0,
78
- defense: 0
79
- },
80
- inventory: []
81
- }
64
+ data: {}
82
65
  });
66
+ user.addBackup({
67
+ username: username,
68
+ password: hash,
69
+ email: email,
70
+ resetToken: null,
71
+ resetExp: null,
72
+ coin: 0,
73
+ home: "/",
74
+ authLevels: [ "Basic" ],
75
+ location: "/the-front",
76
+ attributes: {
77
+ translation: 0,
78
+ strength: 0,
79
+ agility: 0,
80
+ defense: 0
81
+ },
82
+ inventory: []
83
+ });
84
+ user.id = found._id;
85
+ user.data = found.data.backups[0].data;
86
+ user.email = user.data.email;
87
+ await user.commit();
83
88
 
84
89
  return user;
85
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "3.3.6",
3
+ "version": "3.3.7",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {