const express = require('express')
const router = express.Router()
const controller = require('../controllers/auth.controller')
const authentication = require("../../middlewares/authentication.js");
const apiKey = require("../../middlewares/apiKey.js");

router.post('/signIn', apiKey, (req, res) => {
    controller.signIn(req, res)
})

router.post('/signUp',  (req, res) => {
    controller.signUp(req, res)
})

router.get('/me', authentication,apiKey, (req, res) => {
    controller.getUserlogin(req,res)
})

router.post('/send-otp',apiKey, (req, res) => {
    controller.sendOtp(req, res)
})

router.post('/check-otp', apiKey, (req, res) => {
    controller.checkOtp(req, res)
})

router.post("/forgot-password", apiKey, function name(req, res) {
    controller.forgotPassword(req, res);
  });
  
  router.post("/reset/:token", apiKey, function name(req, res) {
    const { token } = req.params;
    controller.resetPassword(req, res, token);
  });

module.exports = router



