mirror of
https://github.com/detleph/server.git
synced 2026-09-07 16:06:18 +02:00
Add a controller and router to update a user's password
+ Add a function to update the password internally + The current interface could be improved (made more RESTful)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import express from "express";
|
||||
import { getAllAdmins, createAdmin } from "../Controllers/admin.controller";
|
||||
import { getAllAdmins, createAdmin, updatePassword } from "../Controllers/admin.controller";
|
||||
import { requireAuthentication } from "../Middleware/auth/auth";
|
||||
|
||||
const router = express.Router();
|
||||
@@ -8,4 +8,7 @@ router.get("/", requireAuthentication, getAllAdmins);
|
||||
|
||||
router.post("/", requireAuthentication, createAdmin);
|
||||
|
||||
// TODO: Use URL parameters to specify the user to update
|
||||
router.put("/password", requireAuthentication, updatePassword);
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user