pl-api: fix sharkey auth

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-06-21 17:43:38 +02:00
parent d7adeaf862
commit 19efa1350d
4 changed files with 9 additions and 9 deletions

View File

@ -527,7 +527,7 @@ class PlApiClient {
* @see {@link https://docs.joinmastodon.org/methods/oauth/#authorize}
*/
authorize: async (params: OauthAuthorizeParams) => {
const response = await this.request('/oauth/authorize', { params });
const response = await this.request('/oauth/authorize', { params, contentType: '' });
return v.parse(v.string(), response.json);
},
@ -577,7 +577,7 @@ class PlApiClient {
id: mastodonTokenResponse.id,
});
} else {
const response = await this.request('/oauth/token', { method: 'POST', body: params });
const response = await this.request('/oauth/token', { method: 'POST', body: params, contentType: '' });
return v.parse(tokenSchema, { scope: params.scope || '', ...response.json });
}
@ -589,7 +589,7 @@ class PlApiClient {
* @see {@link https://docs.joinmastodon.org/methods/oauth/#revoke}
*/
revokeToken: async (params: RevokeTokenParams) => {
const response = await this.request('/oauth/revoke', { method: 'POST', body: params });
const response = await this.request('/oauth/revoke', { method: 'POST', body: params, contentType: '' });
this.#socket?.close();

View File

@ -1,6 +1,6 @@
{
"name": "pl-api",
"version": "1.0.0-rc.79",
"version": "1.0.0-rc.80",
"type": "module",
"homepage": "https://codeberg.org/mkljczk/pl-fe/src/branch/develop/packages/pl-api",
"repository": {

View File

@ -105,7 +105,7 @@
"multiselect-react-dropdown": "^2.0.25",
"mutative": "^1.1.0",
"path-browserify": "^1.0.1",
"pl-api": "^1.0.0-rc.79",
"pl-api": "^1.0.0-rc.80",
"postcss": "^8.5.3",
"process": "^0.11.10",
"punycode": "^2.1.1",

View File

@ -6875,10 +6875,10 @@ pkg-dir@^4.1.0:
dependencies:
find-up "^4.0.0"
pl-api@^1.0.0-rc.79:
version "1.0.0-rc.79"
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.79.tgz#3c49079b0a071784aca3177e7417f1e80efe2a12"
integrity sha512-iXIDxCK1+s9V7a6jfskTYqGuGQk/gvC48A+//5jn8L867QrCmSTN5KuRaMi1J2n/K18y4vhlRs0WgRxwO4xcyA==
pl-api@^1.0.0-rc.80:
version "1.0.0-rc.80"
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.80.tgz#669cc9c8747e03c78314a6a2f8290a32db620623"
integrity sha512-4rJRk+xkoPPRMMdLn7+h7zRA/N07Ho5oEEkE92pSx7HA/CxwFPGOXA1VttJ6p6my27zxPIduMM2RHwCLYbUfVA==
dependencies:
blurhash "^2.0.5"
http-link-header "^1.1.3"