• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

D4rkr34lm / transit-kit / 20370765763

19 Dec 2025 01:00PM UTC coverage: 30.531%. Remained the same
20370765763

push

github

D4rkr34lm
Made more dry

18 of 79 branches covered (22.78%)

Branch coverage included in aggregate %.

0 of 1 new or added line in 1 file covered. (0.0%)

1 existing line in 1 file now uncovered.

51 of 147 relevant lines covered (34.69%)

0.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/server/middleware/auth.ts
1
import { NextFunction, Request, Response } from "express";
2
import expressAsyncHandler from "express-async-handler";
3
import { HttpStatusCodes } from "../constants/HttpStatusCodes";
4
import { authenticate, SecurityScheme } from "../security/SecuritySchema";
5

6
export function buildAuthenticationMiddleware<Caller>(
7
  schemes: SecurityScheme<Caller>[],
8
) {
9
  return expressAsyncHandler(
×
10
    async (request: Request, response: Response, next: NextFunction) => {
11
      const caller = await authenticate(schemes, request);
×
12

13
      if (caller == null) {
×
NEW
14
        response
×
15
          .status(HttpStatusCodes.Unauthorized_401)
16
          .json({ message: "Unauthorized" });
UNCOV
17
        return;
×
18
      }
19
      response.locals.caller = caller;
×
20
      next();
×
21
    },
22
  );
23
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc