#5 89 создание функционала логина

parent b7f75be4
import {Request, Response} from 'express'; import {Request, Response} from 'express';
import {getErrorMessage} from '../utils/errors.util'; import {getErrorMessage} from '../utils/errors.util';
import * as userServices from '../services/user'; import * as userServices from '../services/user';
// import {CustomRequest} from '../middleware/auth';
// export const loginOne = async (req: Request, res: Response) => { export const loginOne = async (req: Request, res: Response) => {
// try { try {
// const foundUser = await userServices.login(req.body); const foundUser = await userServices.login(req.body);
// res.status(200).send(foundUser); res.status(200).send(foundUser);
// } catch (error) { } catch (error) {
// return res.status(500).send(getErrorMessage(error)); return res.status(500).send(getErrorMessage(error));
// } }
// }; };
export const registerOne = async (req: Request, res: Response) => { export const registerOne = async (req: Request, res: Response) => {
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment