Skip to content

Commit

Permalink
patch: revert
Browse files Browse the repository at this point in the history
  • Loading branch information
potts99 committed Nov 12, 2024
1 parent 00b4155 commit 53001dc
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import fs from "fs";
import { exec } from "child_process";
import { track } from "./lib/hog";
import { getEmails } from "./lib/imap";
import { checkToken } from "./lib/jwt";
import { prisma } from "./prisma";
import { registerRoutes } from "./routes";

Expand Down Expand Up @@ -53,23 +52,6 @@ server.get("/", {
response.send({ healthy: true });
});

server.addHook("preHandler", async (request, reply) => {
if (request.url.startsWith("/api/public") || request.url.startsWith("/documentation")) {
return;
}

try {
const bearer = request.headers.authorization?.split(" ")[1];
if (!bearer) throw new Error("No authorization token provided");
await checkToken(bearer);
} catch (error) {
reply.status(401).send({
error: "Authentication failed",
success: false,
});
}
});

const start = async () => {
try {
// Run prisma generate and migrate commands before starting the server
Expand Down

0 comments on commit 53001dc

Please sign in to comment.