mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
19 lines
334 B
TypeScript
19 lines
334 B
TypeScript
import * as api from "./base";
|
|
import { UserAuth } from "./models";
|
|
|
|
export async function setAuth(
|
|
id: number | string = "me",
|
|
data: any,
|
|
): Promise<UserAuth> {
|
|
const userId = id ? id : "me";
|
|
if (data.id) {
|
|
delete data.id;
|
|
}
|
|
|
|
const { result } = await api.post({
|
|
url: `/users/${userId}/auth`,
|
|
data,
|
|
});
|
|
return result;
|
|
}
|