From eba53c37325c4bbac1044d74a49159287a251ff3 Mon Sep 17 00:00:00 2001 From: knotteye Date: Tue, 13 Oct 2020 16:16:37 -0500 Subject: [PATCH] Rework invitation UI a bit, document API changes --- docs/REST.md | 4 +++- src/http.ts | 6 ------ templates/invite.njk | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/REST.md b/docs/REST.md index 3160cf7..c6004a0 100644 --- a/docs/REST.md +++ b/docs/REST.md @@ -91,7 +91,9 @@ Register a new user. **Authentication**: no -**Parameters**: Username, password, confirm +**Parameters**: Username, password, confirm, invite(optional) + +Invite is an optional invite code to bypass disabled registration. **Response**: If successful, returns a json object with the users stream key. Otherwise returns `{error: "error reason"}` diff --git a/src/http.ts b/src/http.ts index 4f2544d..0c0aa6b 100644 --- a/src/http.ts +++ b/src/http.ts @@ -507,12 +507,6 @@ async function initSite(openReg) { } else res.render('invite.njk',Object.assign({icode: req.params.code}, njkconf)); }); - app.get('/invite', (req, res) => { - if(tryDecode(req.cookies.Authorization)) { - res.redirect('/profile'); - } - else res.render('invite.njk',Object.assign({icode: ""}, njkconf)); - }); app.get('/register', (req, res) => { if(tryDecode(req.cookies.Authorization) || !openReg) { res.redirect(njkconf.rootredirect); diff --git a/templates/invite.njk b/templates/invite.njk index 9b2b30b..c181635 100644 --- a/templates/invite.njk +++ b/templates/invite.njk @@ -6,8 +6,8 @@
Username:

Password:

- Confirm:

- Invite Code:


+ Confirm:


+