@rpcbase/server 0.168.0 → 0.170.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.168.0",
3
+ "version": "0.170.0",
4
4
  "license": "SSPL-1.0",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -29,14 +29,21 @@ 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
+ // add email to an array so that in the future
35
+ // we can support multiple accounts on the same session
36
+ if (!req.session.user_emails) {
37
+ req.session.user_emails = []
38
+ }
39
+ req.session.user_emails.push(email)
34
40
  await req.session.save()
35
41
 
36
42
  log("session saved, user is signed in")
37
43
 
38
44
  return {
39
- status: "ok"
45
+ status: "ok",
46
+ user_id,
40
47
  }
41
48
 
42
49
  } else {