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
+1 -1
View File
@@ -16,7 +16,7 @@ const c = initContract();
export const contract = c.router({
authenticate: {
method: 'GET',
path: 'ping.view',
path: 'getUser.view',
query: ssType._parameters.authenticate,
responses: {
200: ssType._response.authenticate,
@@ -132,6 +132,7 @@ export const SubsonicController: InternalControllerEndpoint = {
query: {
c: 'Feishin',
f: 'json',
username: body.username,
v: '1.13.0',
...credentialParams,
},
@@ -143,7 +144,8 @@ export const SubsonicController: InternalControllerEndpoint = {
return {
credential,
userId: null,
isAdmin: resp.body.user.adminRoles,
userId: resp.body.user.username,
username: body.username,
};
},