mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-10 06:12:43 +02:00
check authentication for all servers on initialization and update permission roles
This commit is contained in:
@@ -247,6 +247,14 @@ export const contract = c.router({
|
||||
400: jfType._response.error,
|
||||
},
|
||||
},
|
||||
getUser: {
|
||||
method: 'GET',
|
||||
path: 'users/:id',
|
||||
responses: {
|
||||
200: jfType._response.user,
|
||||
400: jfType._response.error,
|
||||
},
|
||||
},
|
||||
movePlaylistItem: {
|
||||
body: null,
|
||||
method: 'POST',
|
||||
|
||||
@@ -1127,6 +1127,25 @@ export const JellyfinController: InternalControllerEndpoint = {
|
||||
totalRecordCount: res.body.TotalRecordCount,
|
||||
};
|
||||
},
|
||||
getUserInfo: async (args) => {
|
||||
const { apiClientProps, query } = args;
|
||||
|
||||
const res = await jfApiClient(apiClientProps).getUser({
|
||||
params: {
|
||||
id: query.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (res.status !== 200) {
|
||||
throw new Error('Failed to get user info');
|
||||
}
|
||||
|
||||
return {
|
||||
id: res.body.Id,
|
||||
isAdmin: Boolean(res.body.Policy.IsAdministrator),
|
||||
name: res.body.Name,
|
||||
};
|
||||
},
|
||||
movePlaylistItem: async (args) => {
|
||||
const { apiClientProps, query } = args;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user