@rpcbase/server 0.190.0 → 0.192.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/cli/run_docker.js +2 -1
- package/package.json +1 -1
- package/src/auth/sign_up.js +13 -17
package/cli/run_docker.js
CHANGED
|
@@ -8,6 +8,7 @@ const is_production = "yes" === process.env.INFRASTRUCTURE_IS_PRODUCTION
|
|
|
8
8
|
const run_docker = async(infrastructure_dir, proj_prefix) => {
|
|
9
9
|
// env
|
|
10
10
|
const env_path = path.relative(infrastructure_dir, path.join(process.cwd(), "./.env"))
|
|
11
|
+
const base_env_path = path.relative(infrastructure_dir, path.join(process.cwd(), "./.env.base"))
|
|
11
12
|
|
|
12
13
|
const exists = (f) => {
|
|
13
14
|
const target_path = path.join(infrastructure_dir, f)
|
|
@@ -29,7 +30,7 @@ const run_docker = async(infrastructure_dir, proj_prefix) => {
|
|
|
29
30
|
if (!is_production) opts.push("--abort-on-container-exit")
|
|
30
31
|
|
|
31
32
|
const cmd = "docker compose"
|
|
32
|
-
const cmd_args = ["--env-file", env_path, "-p", proj_prefix, ...compose_files, "up", ...opts]
|
|
33
|
+
const cmd_args = ["--env-file", base_env_path, "--env-file", env_path, "-p", proj_prefix, ...compose_files, "up", ...opts]
|
|
33
34
|
|
|
34
35
|
console.log(cmd_args.join(" "))
|
|
35
36
|
|
package/package.json
CHANGED
package/src/auth/sign_up.js
CHANGED
|
@@ -3,8 +3,6 @@ const {hash_password} = require("@rpcbase/std/crypto/hash")
|
|
|
3
3
|
|
|
4
4
|
const mongoose = require("../../mongoose")
|
|
5
5
|
|
|
6
|
-
const HAS_INVITES = process.env.AUTH_DISABLE_INVITES !== "true"
|
|
7
|
-
|
|
8
6
|
const sign_up = async({email, password}, ctx) => {
|
|
9
7
|
const User = mongoose.model("User")
|
|
10
8
|
const Invite = mongoose.model("Invite")
|
|
@@ -22,22 +20,20 @@ const sign_up = async({email, password}, ctx) => {
|
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
// check if we have an invite for this user
|
|
25
|
-
|
|
26
|
-
const invite = await Invite.findOne({email}, null, {ctx})
|
|
23
|
+
const invite = await Invite.findOne({email}, null, {ctx})
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
25
|
+
// TODO: mark invite as accepted here
|
|
26
|
+
if (invite && !invite.is_ready) {
|
|
27
|
+
console.log("found an invite, but not ready", email)
|
|
28
|
+
return {
|
|
29
|
+
status: "error",
|
|
30
|
+
message: "Your invite is still pending approval. Expect an email in the next weeks to activate your account."
|
|
31
|
+
}
|
|
32
|
+
} else if (!invite) {
|
|
33
|
+
console.log("no invite for signup email:", email)
|
|
34
|
+
return {
|
|
35
|
+
status: "error",
|
|
36
|
+
message: "No invite was found for this email"
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
39
|
|