@rpcbase/server 0.167.0 → 0.169.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/express/index.js +5 -0
- package/package.json +1 -1
- package/src/auth/sign_in.js +6 -0
package/express/index.js
CHANGED
|
@@ -51,6 +51,7 @@ module.exports = () => {
|
|
|
51
51
|
// local dev origins
|
|
52
52
|
[
|
|
53
53
|
`http://127.0.0.1:${CLIENT_PORT}`,
|
|
54
|
+
`http://localhost:${CLIENT_PORT}`,
|
|
54
55
|
// `http://192.168.1.83:${CLIENT_PORT}`,
|
|
55
56
|
// `http://192.168.1.140:${CLIENT_PORT}`,
|
|
56
57
|
`http://admin.localhost:${CLIENT_PORT}`,
|
|
@@ -58,6 +59,10 @@ module.exports = () => {
|
|
|
58
59
|
"http://127.0.0.1:8090", // TMP: used by inspected app from admin
|
|
59
60
|
"http://127.0.0.1:8091", // TMP: used by inspected app from admin
|
|
60
61
|
"http://127.0.0.1:9292", // TMP
|
|
62
|
+
// disgusting, sort this out
|
|
63
|
+
"http://localhost:8090", // TMP: used by inspected app from admin
|
|
64
|
+
"http://localhost:8091", // TMP: used by inspected app from admin
|
|
65
|
+
"http://localhost:9292", // TMP
|
|
61
66
|
]
|
|
62
67
|
|
|
63
68
|
if (APP_DOMAIN) {
|
package/package.json
CHANGED
package/src/auth/sign_in.js
CHANGED
|
@@ -31,6 +31,12 @@ const sign_in = async({email, password}, ctx) => {
|
|
|
31
31
|
log("compare_hash is match")
|
|
32
32
|
|
|
33
33
|
req.session.user_id = user._id.toString()
|
|
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")
|