remove file accidently included in rebase

This commit is contained in:
Max Leiter 2022-05-06 21:35:26 -07:00
parent 13040ab8cc
commit 05cc23a144
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA

View file

@ -1,31 +0,0 @@
import { Router } from "express"
import jwt, { UserJwtRequest } from "@lib/middleware/is-signed-in"
import { User } from "@lib/models/User"
export const users = Router()
users.get("/self", jwt, async (req: UserJwtRequest, res, next) => {
const error = () =>
res.status(401).json({
message: "Unauthorized"
})
try {
if (!req.user) {
return error()
}
const user = await User.findByPk(req.user?.id, {
attributes: {
exclude: ["password"]
}
})
if (!user) {
return error()
}
res.json(user)
} catch (error) {
next(error)
}
})