adding axios and call to backend working with the auth check middleware
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import express, { Application, Request, Response } from "express";
|
||||
|
||||
import { authCheck } from "../middleware/auth";
|
||||
|
||||
export default function getUserRoutes() {
|
||||
const router = express.Router();
|
||||
|
||||
// get user details based on id from token
|
||||
router.get("/", getUserDetails);
|
||||
router.get("/", authCheck, getUserDetails);
|
||||
|
||||
return router;
|
||||
}
|
||||
|
||||
async function getUserDetails(req: Request, res: Response) {
|
||||
console.log(req);
|
||||
|
||||
res.send({ message: "check" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user