feat: login route

This commit is contained in:
karishmas6
2024-09-23 23:57:43 +05:30
parent ca175fdcae
commit 72ce72304f

View File

@@ -38,7 +38,7 @@ router.post('/register', async (req, res) => {
} }
}) })
const login = async (req, res) => { router.post('/login', async (req, res) => {
try { try {
const { email, password } = req.body; const { email, password } = req.body;
if (!email || !password) return res.status(400).send('Email and password are required') if (!email || !password) return res.status(400).send('Email and password are required')
@@ -63,7 +63,7 @@ const login = async (req, res) => {
} catch (error) { } catch (error) {
res.status(400).send(`Could not login user - ${error.message}`) res.status(400).send(`Could not login user - ${error.message}`)
} }
} })
const logout = async (req, res) => { const logout = async (req, res) => {
try { try {