server: linting

pull/80/head
Max Leiter 4 years ago
parent 18dff00a93
commit 2a9e7ba6fc
No known key found for this signature in database
GPG Key ID: A3512F2F2F17EBDA

@ -9,7 +9,7 @@ describe("jwt middlware", () => {
beforeEach(() => { beforeEach(() => {
mockRequest = {} mockRequest = {}
mockResponse = { mockResponse = {
sendStatus: jest.fn().mockReturnThis(), sendStatus: jest.fn().mockReturnThis()
} }
}) })

@ -29,7 +29,7 @@ export default async function authenticateToken(
if (authToken.deletedAt) { if (authToken.deletedAt) {
return res.sendStatus(401).json({ return res.sendStatus(401).json({
message: "Token is no longer valid", message: "Token is no longer valid"
}) })
} }

@ -133,7 +133,6 @@ auth.get("/requires-passcode", async (req, res, next) => {
} }
}) })
/** /**
* Creates an access token, stores it in AuthToken table, and returns it * Creates an access token, stores it in AuthToken table, and returns it
*/ */

@ -241,7 +241,10 @@ posts.get(
}), }),
async (req: UserJwtRequest, res, next) => { async (req: UserJwtRequest, res, next) => {
const isUserAuthor = (post: Post) => { const isUserAuthor = (post: Post) => {
return req.user?.id && post.users?.map((user) => user.id).includes(req.user?.id) return (
req.user?.id &&
post.users?.map((user) => user.id).includes(req.user?.id)
)
} }
try { try {

Loading…
Cancel
Save