Untitled
unknown
plain_text
8 months ago
484 B
2
Indexable
Never
// controller login const auth = require('../utils/auth'); const controllerLogin = async (req, res) => { const { email, password } = req.body; if (!email || !password) { return res.status(400).json({ message: 'Some required fields are missing' }); } const token = await auth.loginAuth(email, password); if (!token) { return res.status(400).json({ message: 'Invalid fields' }); } return res.status(200).json({ token }); }; module.exports = { controllerLogin };
Leave a Comment