Converted the account system to an auth system

This commit is contained in:
2021-03-07 00:41:19 +11:00
parent 725842f672
commit 2e024f71c3
27 changed files with 4495 additions and 7 deletions
+18 -4
View File
@@ -1,10 +1,24 @@
const express = require('express');
const router = express.Router();
//the routes
//TODO: import the routes here
//middleware
const authToken = require('../utilities/token-auth');
//basic route management
//TODO: define the routes here
//signup -> validate -> login all without a token
router.post('/signup', require('./signup'));
router.get('/validation', require('./validation'));
router.post('/login', require('./login'));
//refresh token
router.post('/token', require('./token'));
//middleware
router.use(authToken);
//basic account management (needs a token)
router.delete('/logout', require('./logout'));
router.get('/account', require('./account'));
router.patch('/update', require('./update'));
router.delete('/deletion', require('./deletion'));
module.exports = router;