Skip to content

Commit

Permalink
fix loading error
Browse files Browse the repository at this point in the history
  • Loading branch information
nmr2701 committed Oct 22, 2024
1 parent f0738f6 commit 5537477
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 4 deletions.
3 changes: 0 additions & 3 deletions backend/authMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import jwt from 'jsonwebtoken';
import { Request, Response, NextFunction } from 'express';
// Define the authentication middleware function
export const authMiddleware = (req: Request, res: Response, next: NextFunction) => {
console.log("Request Headers:", req.headers);
const token = req.headers['x-org-token'];
console.log("Token from headers:", token);


// Retrieve the public key from environment variables
Expand All @@ -31,7 +29,6 @@ export const authMiddleware = (req: Request, res: Response, next: NextFunction)
(error as any).code = 401;
throw error;
}
console.log("decoded", decodedAuthToken)
// Check if the user is part of the required organization
const userOrgs = decodedAuthToken.orgs

Expand Down
1 change: 0 additions & 1 deletion backend/graphql/resolvers/graphql_resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export const resolvers = {

try {
// await authMiddleware(req, res, () => {});
console.log(userId);

const upload = await file; // Resolve the file promise to get Upload object

Expand Down
50 changes: 50 additions & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@apollo/server": "^4.9.3",
"@clerk/clerk-sdk-node": "^5.0.9",
"@clerk/types": "^4.5.1",
"@types/koa": "^2.15.0",
"@types/mongoose": "^5.11.97",
"apollo-server-express": "^3.12.1",
"apollo-upload-client": "^18.0.1",
Expand Down

0 comments on commit 5537477

Please sign in to comment.