(Rich Presence / jellyfin): Use Authorization for authentication instead of api_key= (fixes #1375) (#1376)
* fix(richPresence/jellyfin): Use Authorization instead of query arg * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
54d5b6e295
commit
d07550ea7d
2 changed files with 8 additions and 2 deletions
|
|
@ -40,7 +40,13 @@ async function fetchMediaData(): Promise<JfMediaData | null> {
|
|||
|
||||
try {
|
||||
const baseUrl = (jf_serverUrl.startsWith("http") ? jf_serverUrl : `https://${jf_serverUrl}`).replace(/\/$/, "");
|
||||
const res = await fetch(`${baseUrl}/Sessions?api_key=${jf_apiKey}`);
|
||||
const res = await fetch(`${baseUrl}/Sessions`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Accept": "application/json",
|
||||
"Authorization": `MediaBrowser Token="${jf_apiKey}"`
|
||||
}
|
||||
});
|
||||
if (!res.ok) throw `${res.status} ${res.statusText}`;
|
||||
|
||||
const contentType = res.headers.get("content-type") ?? "";
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import definePlugin, { OptionType } from "@utils/types";
|
|||
import type { Emoji, Message, RenderModalProps, Sticker } from "@vencord/discord-types";
|
||||
import { StickerFormatType } from "@vencord/discord-types/enums";
|
||||
import { findByCodeLazy, findByPropsLazy, proxyLazyWebpack } from "@webpack";
|
||||
import { ChannelStore, ConfirmModal, DraftType, EmojiStore, FluxDispatcher, Forms, GuildMemberStore, IconUtils, openModal, OverridePremiumTypeStore, PermissionsBits, PermissionStore, StickersStore, UploadHandler, UserSettingsActionCreators, UserSettingsProtoStore, UserStore } from "@webpack/common";
|
||||
import { ChannelStore, ConfirmModal, DraftType, EmojiStore, FluxDispatcher, GuildMemberStore, IconUtils, openModal, OverridePremiumTypeStore, PermissionsBits, PermissionStore, StickersStore, UploadHandler, UserSettingsActionCreators, UserSettingsProtoStore } from "@webpack/common";
|
||||
import { applyPalette, GIFEncoder, quantize } from "gifenc";
|
||||
import type { ReactElement, ReactNode } from "react";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue