23 lines
743 B
TypeScript
23 lines
743 B
TypeScript
import express from "express";
|
|
import ParamaterPassCheckHelper from "../helpers/parameterPassCheckHelper";
|
|
import { finishReset, startReset, verifyReset } from "../controller/resetController";
|
|
|
|
var router = express.Router({ mergeParams: true });
|
|
|
|
router.post("/verify", ParamaterPassCheckHelper.requiredIncludedMiddleware(["mail", "token"]), async (req, res) => {
|
|
await verifyReset(req, res);
|
|
});
|
|
|
|
router.post("/", ParamaterPassCheckHelper.requiredIncludedMiddleware(["username"]), async (req, res) => {
|
|
await startReset(req, res);
|
|
});
|
|
|
|
router.put(
|
|
"/",
|
|
ParamaterPassCheckHelper.requiredIncludedMiddleware(["mail", "token", "secret", "routine"]),
|
|
async (req, res) => {
|
|
await finishReset(req, res);
|
|
}
|
|
);
|
|
|
|
export default router;
|