mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-10-04 20:00:12 +00:00
Introducing the Setup Wizard for creating the first user
- no longer setup a default - still able to do that with env vars however
This commit is contained in:
@@ -1,12 +1,27 @@
|
||||
import * as api from "./base";
|
||||
import type { User } from "./models";
|
||||
|
||||
export async function createUser(item: User, abortController?: AbortController): Promise<User> {
|
||||
export interface AuthOptions {
|
||||
type: string;
|
||||
secret: string;
|
||||
}
|
||||
|
||||
export interface NewUser {
|
||||
name: string;
|
||||
nickname: string;
|
||||
email: string;
|
||||
isDisabled?: boolean;
|
||||
auth?: AuthOptions;
|
||||
roles?: string[];
|
||||
}
|
||||
|
||||
export async function createUser(item: NewUser, noAuth?: boolean, abortController?: AbortController): Promise<User> {
|
||||
return await api.post(
|
||||
{
|
||||
url: "/users",
|
||||
// todo: only use whitelist of fields for this data
|
||||
data: item,
|
||||
noAuth,
|
||||
},
|
||||
abortController,
|
||||
);
|
||||
|
Reference in New Issue
Block a user