@rpcbase/server 0.169.0 → 0.171.0

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": "@rpcbase/server",
3
- "version": "0.169.0",
3
+ "version": "0.171.0",
4
4
  "license": "SSPL-1.0",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -29,8 +29,8 @@ const sign_in = async({email, password}, ctx) => {
29
29
 
30
30
  if (is_match) {
31
31
  log("compare_hash is match")
32
-
33
- req.session.user_id = user._id.toString()
32
+ const user_id = user._id.toString()
33
+ req.session.user_id = user_id
34
34
  // add email to an array so that in the future
35
35
  // we can support multiple accounts on the same session
36
36
  if (!req.session.user_emails) {
@@ -42,7 +42,8 @@ const sign_in = async({email, password}, ctx) => {
42
42
  log("session saved, user is signed in")
43
43
 
44
44
  return {
45
- status: "ok"
45
+ status: "ok",
46
+ user_id,
46
47
  }
47
48
 
48
49
  } else {
@@ -49,14 +49,15 @@ const sign_up = async({email, password}, ctx) => {
49
49
  })
50
50
 
51
51
  // sign the user in
52
- req.session.user_id = user._id.toString()
52
+ const user_id = user._id.toString()
53
+ req.session.user_id = user_id
53
54
 
54
55
  await req.session.save()
55
56
  await user.save({ctx})
56
57
 
57
58
  return {
58
59
  status: "ok",
59
- user_id: user._id
60
+ user_id,
60
61
  }
61
62
  }
62
63