File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed
Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import fs from "fs";
77import { exec } from "child_process" ;
88import { track } from "./lib/hog" ;
99import { getEmails } from "./lib/imap" ;
10- import { checkToken } from "./lib/jwt" ;
1110import { prisma } from "./prisma" ;
1211import { 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-
7355const start = async ( ) => {
7456 try {
7557 // Run prisma generate and migrate commands before starting the server
You can’t perform that action at this time.
0 commit comments