Files
Ucharify_api/app/routes/auth.route.js
Arjun Patel 2bf26fccbf added roles with checking in middleware
- still need signup for orgs
- login for admin
2019-01-26 20:23:06 -08:00

15 lines
481 B
JavaScript

const express = require('express'),
router = express.Router(),
checkAuth = require('../middleware/check-auth'),
roles = require('../helpers/roles');
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));
// Check database for org and get token with org role
router.post('/org/login', auth.login('org', roles.ORGANIZATION));
module.exports = router;