User: Task: "Create Router for APIs"
    Description: "Generate router code that includes POST method endpoints for each given API"
    Requirements:
    - Database: mongoose
    - Authentication: None specified
    - Output needed: Return only the function code as specified in dependencies
    - Dependencies: Import the express module using `const express = require('express');`, 
Import the controller file from `../controllers/authController.js` and assign it to `authCntl`, 
Initialize the router using `const router = express.Router();`, 
For each API endpoint name provided in the supporting data, create a POST route in the form `router.post('/endpoint', authCntl.apiName) `, 
Read each API name from the supporting data and dynamically create a route for each, 
For api have id params in the route as in this form `router.post('/endpoint/:taskId', authCtl.apiName)`, 
Export the router using `module.exports = router;` at the end
    - Previous Code 
    - Supporting data 
const mongoose = require('mongoose');
const bcrypt = require('bcrypt');
// Assuming that you have a User model defined in your Mongoose models
const User = require('../models/User'); // Adjust the path as necessary

exports.registerUser = async (req, res) => {
    try {
        const { name, email, password } = req.body;
        
        // Validate required fields
        if (!name || !email || !password) {
            return res.status(400).json({ error: 'Name, email, and password are required.' });
        }

        // Check if the email is already registered
        const existingUser = await User.findOne({ email });
        if (existingUser) {
            return res.status(400).json({ error: 'Email is already registered.' });
        }

        // Hash the password before saving
        const saltRounds = 10;
        const hashedPassword = await bcrypt.hash(password, saltRounds);

        // Create a new user with status active
        const newUser = new User({
            name,
            email,
            password: hashedPassword,
            status: 'active'
        });

        // Save the new user to the database
        await newUser.save();

        // Respond with a success message containing user details (excluding password)
        res.status(201).json({ message: 'User registered successfully.', user: {
            id: newUser._id,
            name: newUser.name,
            email: newUser.email,
            status: newUser.status
        }});
    } catch (error) {
        // Handle errors like invalid email format or database issues
        res.status(500).json({ error: 'An error occurred while registering the user.' });
    }
};

// Assuming that you have a User model defined in your Mongoose models
const User = require('../models/User'); // Adjust the path as necessary

exports.loginUser = async (req, res) => {
    try {
        const { email, password } = req.body;

        // Validate required fields
        if (!email || !password) {
            return res.status(400).json({ error: 'Email and password are required.' });
        }

        // Find user by email
        const user = await User.findOne({ email });
        if (!user) {
            // User not found
            return res.status(401).json({ error: 'Invalid credentials.' });
        }

        // Compare provided password with the stored hashed password
        const isPasswordValid = await bcrypt.compare(password, user.password);
        if (!isPasswordValid) {
            // Incorrect password
            return res.status(401).json({ error: 'Invalid credentials.' });
        }

        // Respond with user details, excluding the password
        res.status(200).json({
            message: 'Login successful.',
            user: {
                id: user._id,
                name: user.name,
                email: user.email,
                status: user.status
            }
        });
    } catch (error) {
        // Handle database or other errors
        res.status(500).json({ error: 'An error occurred during login.' });
    }
};

    - Updating File undefined
    
    Please generate the code for this task, following the instructions and including comments for clarity.
    While creating router for specifict file your have to read supporing file data and create for that 

    **Output Formats**: 

Return dependencies like this `const bcrypt = require('bcrypt');`  in this formate
```dependencies
const bcrypt = require('bcrypt');
```

Ensure this format is consistently followed in responses.
    
User: 


    
Assistant: