-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
596741f
commit b7d0193
Showing
4 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import Express from "express"; | ||
import { validateToken } from "../middleware/auth"; | ||
import { getUserProfile } from "../controller"; | ||
import { checkAuthorisation, validateToken } from "../middleware/auth"; | ||
import { getUserProfile, getUserProfileById, updateUserController } from "../controller"; // Import the new controller | ||
|
||
|
||
const UserRouter = new Express.Router(); | ||
|
||
// Route to get the profile of the logged-in user | ||
UserRouter.get("/", validateToken, getUserProfile); | ||
|
||
// Route to get the profile of a user by ID | ||
UserRouter.get("/:id", validateToken, getUserProfileById); // New route | ||
Check failure Code scanning / CodeQL Missing rate limiting High
This route handler performs
authorization Error loading related location Loading Check failure Code scanning / CodeQL Missing rate limiting High
This route handler performs
a database access Error loading related location Loading |
||
|
||
// Route to update the profile of a user by ID | ||
UserRouter.put("/:id", validateToken,checkAuthorisation, updateUserController) | ||
Check failure Code scanning / CodeQL Missing rate limiting High
This route handler performs
authorization Error loading related location Loading Check failure Code scanning / CodeQL Missing rate limiting High
This route handler performs
a database access Error loading related location Loading |
||
|
||
export default UserRouter; |