mirror of
https://github.com/anultravioletaurora/Jellify.git
synced 2026-05-07 22:19:31 -05:00
lots of stuff
lets see if I can authenticate and get pushed to the library selection
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { JellyfinCredentials } from "../types/jellyfin-credentials";
|
||||
import { MutationKeys } from "../../enums/mutation-keys";
|
||||
import { createPublicApi } from "../queries/functions/api";
|
||||
import { fetchServer } from "../queries/functions/storage";
|
||||
|
||||
export const authenticateWithCredentials = useMutation({
|
||||
mutationKey: [MutationKeys.AuthenticationWithCredentials],
|
||||
mutationFn: async (credentials: JellyfinCredentials) => {
|
||||
createPublicApi((await fetchServer()).url)
|
||||
.authenticateUserByName(credentials.username, credentials.password!);
|
||||
},
|
||||
onSuccess(data, credentials, context) {
|
||||
|
||||
},
|
||||
})
|
||||
@@ -1,20 +0,0 @@
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { MutationKeys } from "../../enums/mutation-keys";
|
||||
|
||||
import { JellyfinCredentials } from "../types/jellyfin-credentials";
|
||||
import { mutateServer, mutateServerCredentials } from "./functions/storage";
|
||||
import { JellifyServer } from "../../types/JellifyServer";
|
||||
|
||||
export const jellifyServerMutation = useMutation({
|
||||
mutationKey: [MutationKeys.ServerUrl],
|
||||
mutationFn: async (server: JellifyServer | undefined) => {
|
||||
return mutateServer(server)
|
||||
}
|
||||
});
|
||||
|
||||
export const credentials = useMutation({
|
||||
mutationKey: [MutationKeys.Credentials],
|
||||
mutationFn: async (credentials: JellyfinCredentials) => {
|
||||
return mutateServerCredentials(credentials)
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user