fix: update src/routes/_api/oauth.js

pull/2343/head
Nolan Lawson 2023-01-08 21:43:16 -08:00 zatwierdzone przez GitHub
rodzic bf32c3b4ab
commit 623e6c50ae
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -27,6 +27,8 @@ export function generateAuthLink(instanceName, clientId, redirectUri) {
export function getAccessTokenFromAuthCode(instanceName, clientId, clientSecret, code, redirectUri) {
const url = `${basename(instanceName)}/oauth/token`
// Using URLSearchParams here guarantees a content type of application/x-www-form-urlencoded
// See https://fetch.spec.whatwg.org/#bodyinit-unions
return post(url, new URLSearchParams({
client_id: clientId,
client_secret: clientSecret,