feat(server): DELETE /api/me deletes your account; smoke test cleans up after itself
This commit is contained in:
@@ -45,6 +45,8 @@ app.post('/api/auth/login', authLimit, run(req => auth.login(body(req).login ||
|
||||
app.post('/api/auth/guest', authLimit, run(req => auth.guest(body(req).name)));
|
||||
app.post('/api/auth/refresh', run(req => auth.refresh(body(req).refreshToken)));
|
||||
app.post('/api/auth/logout', run(req => { auth.logout(body(req).refreshToken); return { ok: true }; }));
|
||||
// delete your own account (and with it every save and token) - smoke tests clean up with this, players may too
|
||||
app.delete('/api/me', run(req => { const u = need(req); lobby.leave(u.uid); require('./db').Users.del.run(u.uid); return { ok: true }; }));
|
||||
app.get('/api/me', (req, res) => res.json(req.user ? { uid: req.uid, name: req.user.name, guest: req.user.guest, admin: req.user.admin } : { uid: null, admin: false }));
|
||||
|
||||
// --- online save: read, shop/workshop actions (server-authoritative), cosmetics ------------------------
|
||||
|
||||
Reference in New Issue
Block a user