add isAdmin to auth state

This commit is contained in:
jeffvli
2025-12-07 17:21:46 -08:00
parent 2f2dbbde3e
commit 4ddada1fe3
10 changed files with 51 additions and 3 deletions
+19 -1
View File
@@ -7,7 +7,24 @@ const baseResponse = z.object({
}),
});
const authenticate = z.null();
const authenticate = z.object({
user: z.object({
adminRoles: z.boolean(),
commentRole: z.boolean(),
coverArtRole: z.boolean(),
downloadRole: z.boolean(),
folder: z.string().array(),
jukeboxRole: z.boolean(),
playlistRole: z.boolean(),
podcastRole: z.boolean(),
scrobblingEnabled: z.boolean(),
settingsRole: z.boolean(),
shareRole: z.boolean(),
streamRole: z.boolean(),
uploadRole: z.boolean(),
username: z.string(),
}),
});
const authenticateParameters = z.object({
c: z.string(),
@@ -16,6 +33,7 @@ const authenticateParameters = z.object({
s: z.string().optional(),
t: z.string().optional(),
u: z.string(),
username: z.string(),
v: z.string(),
});
+2
View File
@@ -86,6 +86,7 @@ export type QueueSong = Song & {
export type ServerListItem = {
features?: ServerFeatures;
id: string;
isAdmin?: boolean;
musicFolderId?: string[];
name: string;
preferInstantMix?: boolean;
@@ -237,6 +238,7 @@ export type Artist = {
export type AuthenticationResponse = {
credential: string;
isAdmin?: boolean;
ndCredential?: string;
userId: null | string;
username: string;