Skip to content

Commit 53001dc

Browse files
committed
patch: revert
1 parent 00b4155 commit 53001dc

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

apps/api/src/main.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import fs from "fs";
77
import { exec } from "child_process";
88
import { track } from "./lib/hog";
99
import { getEmails } from "./lib/imap";
10-
import { checkToken } from "./lib/jwt";
1110
import { prisma } from "./prisma";
1211
import { registerRoutes } from "./routes";
1312

@@ -53,23 +52,6 @@ server.get("/", {
5352
response.send({ healthy: true });
5453
});
5554

56-
server.addHook("preHandler", async (request, reply) => {
57-
if (request.url.startsWith("/api/public") || request.url.startsWith("/documentation")) {
58-
return;
59-
}
60-
61-
try {
62-
const bearer = request.headers.authorization?.split(" ")[1];
63-
if (!bearer) throw new Error("No authorization token provided");
64-
await checkToken(bearer);
65-
} catch (error) {
66-
reply.status(401).send({
67-
error: "Authentication failed",
68-
success: false,
69-
});
70-
}
71-
});
72-
7355
const start = async () => {
7456
try {
7557
// Run prisma generate and migrate commands before starting the server

0 commit comments

Comments
 (0)