From 12f81f4d2c1ca90efb9e1fcf231bf148cce85bb3 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 29 Apr 2020 19:42:20 +0200 Subject: [PATCH] Can check user password --- src/controllers/Routes.ts | 2 ++ src/controllers/SettingsController.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/controllers/Routes.ts b/src/controllers/Routes.ts index 4a8b371..f0d40f5 100644 --- a/src/controllers/Routes.ts +++ b/src/controllers/Routes.ts @@ -113,6 +113,8 @@ export const Routes : Route[] = [ {path: "/settings/set_security", cb: (h) => SettingsController.SetSecurity(h)}, + {path: "/settings/check_password", cb: (h) => SettingsController.CheckUserPassword(h)}, + {path: "/settings/update_password", cb: (h) => SettingsController.UpdatePassword(h)}, {path: "/settings/get_account_image", cb: (h) => SettingsController.GetAccountImageSettings(h)}, diff --git a/src/controllers/SettingsController.ts b/src/controllers/SettingsController.ts index 8c1b56b..55aee86 100644 --- a/src/controllers/SettingsController.ts +++ b/src/controllers/SettingsController.ts @@ -190,6 +190,18 @@ export class SettingsController { h.success(); } + /** + * Check current user password + * + * @param h Request handler + */ + public static async CheckUserPassword(h: RequestHandler) { + + await h.needUserPostPassword("password"); + + h.success(); + } + /** * Update user password *