mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-10-04 11:50:09 +00:00
27 lines
460 B
TypeScript
27 lines
460 B
TypeScript
import * as api from "./base";
|
|
import type { User } from "./models";
|
|
|
|
export async function updateAuth(
|
|
userId: number | "me",
|
|
newPassword: string,
|
|
current?: string,
|
|
abortController?: AbortController,
|
|
): Promise<User> {
|
|
const data = {
|
|
type: "password",
|
|
current: current,
|
|
secret: newPassword,
|
|
};
|
|
if (userId === "me") {
|
|
data.current = current;
|
|
}
|
|
|
|
return await api.put(
|
|
{
|
|
url: `/users/${userId}/auth`,
|
|
data,
|
|
},
|
|
abortController,
|
|
);
|
|
}
|