diff --git a/auth/README.md b/auth/README.md index f1ec024..4a1d9cc 100644 --- a/auth/README.md +++ b/auth/README.md @@ -57,7 +57,6 @@ ```json { - "username": "hager", "email": "test@test.com", "password": "12345678" } @@ -88,7 +87,7 @@ - **verify** - POST + GET http://178.128.140.169:4002/api/v1/auth/verify diff --git a/auth/src/routes/verify.ts b/auth/src/routes/verify.ts index c81b53d..a10d17a 100644 --- a/auth/src/routes/verify.ts +++ b/auth/src/routes/verify.ts @@ -7,7 +7,7 @@ dotenv.config(); const router = express.Router(); -router.post(`${baseUrl}/verify`, (req, res) => { +router.get(`${baseUrl}/verify`, (req, res) => { const token = req.header("Authorization")?.split(" ")[1]; const role = req.body.role; if (!token) { @@ -20,15 +20,13 @@ router.post(`${baseUrl}/verify`, (req, res) => { if (role && payload.role != role) { return res.status(400).send("Role not authorized"); } - return res - .status(200) - .send({ - message: "Verified", - _id: payload._id, - username: payload.username, - email: payload.email, - role: payload.role, - }); + return res.status(200).send({ + message: "Verified", + _id: payload._id, + username: payload.username, + email: payload.email, + role: payload.role, + }); } catch (err) { return res.status(400).send("Invalid Token"); }