Make Authentik users from Apps → Authentik, with a one-time recovery link

An administrator can make a user (user name, name, optional email, groups)
and gets a recovery link to send them, so they choose their own password;
no password is set or seen here. Uses a separate optional "Token for making
users" on the Authentik integration; reading never uses it, and it can be
removed again from the page. The link is shown once and never stored or
audited; the audit log records who made which user and link.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-01 00:18:25 +01:00
1 parent 9ca83994fb
commit aa95d6b314
13 files changed
+892 -18

No files matched your search

+26
View File
@@ -1737,6 +1737,8 @@ export interface AuthentikInfo {
id: number;
name: string;
enabled: boolean;
/** Whether it was given a token to make users with. */
canCreateUsers: boolean;
status: { at: string; ok: boolean; error: string | null } | null;
fresh: boolean;
state: {
@@ -1755,6 +1757,27 @@ export interface AuthentikInfo {
problems: { key: string; message: string; severity: "warning" | "critical" }[];
}
/** A group in Authentik a new user can be put in; `admin` ones make the user an administrator there. */
export interface AuthentikGroup {
id: string;
name: string;
admin: boolean;
}
export interface AuthentikNewUser {
username: string;
name: string;
email: string;
groups: string[];
}
/** A user Authentik made, and the one-time link for them to choose a password with (null, with the reason, when that could not be made). */
export interface AuthentikUserMade {
user: { pk: number; username: string; name: string };
link: string | null;
linkError: string | null;
}
export interface JellyfinHistory {
jellyfin: { id: number; name: string };
days: number;
@@ -3387,6 +3410,9 @@ export const api = {
},
authentik: {
list: () => request<{ authentiks: AuthentikInfo[] }>("/api/authentik"),
groups: (id: number) => request<{ groups: AuthentikGroup[] }>(`/api/authentik/${id}/groups`),
createUser: (id: number, body: AuthentikNewUser) => request<AuthentikUserMade>(`/api/authentik/${id}/users`, { method: "POST", body: JSON.stringify(body) }),
removeWriteToken: (id: number) => request<void>(`/api/authentik/${id}/write-token`, { method: "DELETE" }),
},
jellyfin: {
list: () => request<{ jellyfins: JellyfinInfo[] }>("/api/jellyfin"),