Commit cd4ef015 authored by Pavel Mishakov's avatar Pavel Mishakov

user controller fix

parent aabf6f85
......@@ -3,6 +3,7 @@ import express, {Request, Response, Router} from 'express'
import IResponse from "../interfaces/IResponse"
import IUser from "../interfaces/IUser"
import { User } from "../models/mongo/User"
import { EStatuses } from "../enums/EStatuses"
......@@ -53,13 +54,13 @@ export class UserController {
console.log(user)
if(!user) {
res.status(200).send({
isStatusOk: false,
status: EStatuses.OK,
result: undefined,
message: 'Not authorized'
})
} else {
const response: IResponse<IUser | undefined> = {
isStatusOK: true,
status: EStatuses.NOT_OK,
result: user,
message: 'Token is ok'
}
......
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