Delete user accounts in your Express app. The module is part of Lockit.
npm install lockit-delete-account
var config = require('./config.js'); var deleteAccount = require('lockit-delete-account'); var app = express(); // express settings // ... // sessions are required - either cookie or some sort of db app.use(express.cookieParser('your secret here')); app.use(express.cookieSession()); app.use(app.router); // use middleware after router so it doesn't interfere with your own routes deleteAccount(app, config); // serve static files as last middleware app.use(express.static(path.join(__dirname, 'public')));
More about configuration at Lockit.
- input validation
- match public phrase
- session verification
- kill current session
- remove user from db
- GET /delete-account
- POST /delete-account
If you've set
exports.rest = true in your
config.js the module behaves as follows.
- all routes have
next()ed and you can catch
/delete-accounton the client
POST /rest/delete-accountstays the same but sends JSON
Copyright (C) 2013 Mirco Zeiss
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.