appears to have a protected route
This commit is contained in:
@@ -26,7 +26,7 @@ module.exports = class Item {
|
||||
|
||||
static async getOne(id) {
|
||||
const query = `SELECT * FROM item WHERE id = $1`;
|
||||
const result = await pool.query(query, [id]);
|
||||
const result = await pool.query(query, [parseInt(id)]);
|
||||
if (result.rows.length) {
|
||||
return result.rows[0];
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ async function authRoute(app, passport) {
|
||||
}
|
||||
})
|
||||
|
||||
router.post('/login', passport.authenticate('local'), async (req, res, next) => {
|
||||
router.post('/login', async (req, res, next) => {
|
||||
try {
|
||||
const data = req.body;
|
||||
let response = await AuthController.login(data);
|
||||
|
||||
Reference in New Issue
Block a user