fix: Require mfa code for password change if its enabled (#10341)

This commit is contained in:
Tomi Turtiainen
2024-08-12 17:08:55 +03:00
committed by GitHub
parent 2580a5e19e
commit 9d7caacc69
10 changed files with 141 additions and 26 deletions

View File

@@ -116,9 +116,15 @@ export async function updateOtherUserSettings(
return await makeRestApiRequest(context, 'PATCH', `/users/${userId}/settings`, settings);
}
export type UpdateUserPasswordParams = {
newPassword: string;
currentPassword: string;
mfaCode?: string;
};
export async function updateCurrentUserPassword(
context: IRestApiContext,
params: { newPassword: string; currentPassword: string },
params: UpdateUserPasswordParams,
): Promise<void> {
return await makeRestApiRequest(context, 'PATCH', '/me/password', params);
}