adding join endpoint

This commit is contained in:
metacryst
2026-01-13 08:59:45 -06:00
parent 942e479185
commit f2b5ba89eb
5 changed files with 9 additions and 18 deletions

View File

@@ -35,7 +35,7 @@ class Server {
router.get('/signout', this.auth.logout)
/* Site */
router.post('/signup', this.verifySignupToken, this.newUserSubmission)
router.post('/free', this.newUserSubmission)
router.get('/db/images/*', this.getUserImage)
router.get('/app/comaldata', this.getComalData)
router.get('/*', this.get)
@@ -79,12 +79,8 @@ class Server {
}
newUserSubmission = async (req, res) => {
const { token } = req.query;
try {
let tokenData = db.tokens.get(token)
if(tokenData.used) throw new global.ServerError(400, "Token alredy used!")
await db.members.add(req.body, tokenData.uuid)
db.tokens.markUsed(token)
await db.members.add(req.body)
global.db.saveData()
return res.status(200).json({});
} catch(e) {