feat: add password change, class unenroll, and optional notify flags
Let admins skip SMS on user, class, and invoice actions, and let users change their own password with the current one.
This commit is contained in:
@@ -22,3 +22,13 @@ exports.logout = catchAsync(async (req, res, next) => {
|
||||
await authService.logout(userId, refreshToken);
|
||||
return successResponse(res, 200, 'Logout successful');
|
||||
});
|
||||
|
||||
exports.changePassword = catchAsync(async (req, res) => {
|
||||
const { currentPassword, newPassword, refreshToken } = req.body;
|
||||
await authService.changePassword(req.user._id, {
|
||||
currentPassword,
|
||||
newPassword,
|
||||
refreshToken
|
||||
});
|
||||
return successResponse(res, 200, 'Password changed successfully');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user