separating donor and org login controller functions

This commit is contained in:
Arjun Patel
2019-03-14 17:28:09 -07:00
parent c3f6184cc6
commit a7619fcad9
2 changed files with 48 additions and 18 deletions
+3 -4
View File
@@ -1,14 +1,13 @@
const express = require('express'),
router = express.Router(),
checkAuth = require('../middleware/check-auth'),
roles = require('../helpers/roles');
checkAuth = require('../middleware/check-auth');
const auth = require('../controllers/auth.controller.js');
// Check database for donor and get token with donor role
router.post('/donor/login', auth.login('donor', roles.DONOR));
router.post('/donor/login', auth.donorLogin);
// Check database for org and get token with org role
router.post('/org/login', auth.login('org', roles.ORGANIZATION));
router.post('/org/login', auth.orgLogin);
module.exports = router;