diff options
author | Akshay <[email protected]> | 2024-11-22 19:48:31 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2024-11-22 19:48:31 +0000 |
commit | 622c5fee25e7d86914d343ca3f873dc4bd55ffad (patch) | |
tree | 6543c2ef3499eecee3842f433599aaae6c4c2f14 /src/invite.js | |
parent | 3551ff7a202ad60362888888c42f88b37e32fc59 (diff) |
rework invite and admins a bit
Diffstat (limited to 'src/invite.js')
-rw-r--r-- | src/invite.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/invite.js b/src/invite.js index 7e357ac..f0bc9b9 100644 --- a/src/invite.js +++ b/src/invite.js | |||
@@ -1,6 +1,14 @@ | |||
1 | const { db } = require("./db"); | 1 | const { db } = require("./db"); |
2 | 2 | ||
3 | const validateInviteToken = async (req, res, next) => { | 3 | const validateInviteToken = async (req, res, next) => { |
4 | const isFirstUser = db.query("SELECT 1 FROM users LIMIT 1").get() === null; | ||
5 | |||
6 | if (isFirstUser) { | ||
7 | req.isFirstUser = true; | ||
8 | next(); | ||
9 | return; | ||
10 | } | ||
11 | |||
4 | const token = req.query.token; | 12 | const token = req.query.token; |
5 | 13 | ||
6 | if (!token) { | 14 | if (!token) { |