@rpcbase/server 0.189.0 → 0.191.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 +1 -1
- package/package.json +1 -1
- package/src/auth/sign_up.js +13 -17
package/cli/run_docker.js
CHANGED
|
@@ -25,7 +25,7 @@ const run_docker = async(infrastructure_dir, proj_prefix) => {
|
|
|
25
25
|
compose_files.push("-f", "dev.yml")
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const opts = ["--build", "--quiet-pull"
|
|
28
|
+
const opts = ["--build", /*"--quiet-pull",*/ "--remove-orphans", "--force-recreate"]
|
|
29
29
|
if (!is_production) opts.push("--abort-on-container-exit")
|
|
30
30
|
|
|
31
31
|
const cmd = "docker compose"
|
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
|
|