Skip to content

Build your personal knowledge base with Trilium Notes

chore(server): remove leftover from migration to core

Elian Dorancfa19cddd565
diff --git a/apps/server/src/routes/api/password.ts b/apps/server/src/routes/api/password.ts
deleted file mode 100644
index 3c46fb825f..0000000000
--- a/apps/server/src/routes/api/password.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { ChangePasswordResponse } from "@triliumnext/commons";
-import { password as passwordService, ValidationError } from "@triliumnext/core";
-import type { Request } from "express";
-
-async function changePassword(req: Request): Promise<ChangePasswordResponse> {
- if (passwordService.isPasswordSet()) {
- return await passwordService.changePassword(req.body.current_password, req.body.new_password);
- }
- return await passwordService.setPassword(req.body.new_password);
-}
-
-function resetPassword(req: Request) {
- // protection against accidental call (not a security measure)
- if (req.query.really !== "yesIReallyWantToResetPasswordAndLoseAccessToMyProtectedNotes") {
- throw new ValidationError("Incorrect password reset confirmation");
- }
-
- return passwordService.resetPassword();
-}
-
-export default {
- changePassword,
- resetPassword
-};