@fleetkeep/cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth.mjs +9 -2
- package/package.json +1 -1
package/auth.mjs
CHANGED
|
@@ -125,7 +125,11 @@ export function authorizationRequest(config = oauthConfig()) {
|
|
|
125
125
|
async function tokenRequest(parameters, config = oauthConfig()) {
|
|
126
126
|
const response = await fetch(config.tokenEndpoint, {
|
|
127
127
|
method: 'POST',
|
|
128
|
-
headers: {
|
|
128
|
+
headers: {
|
|
129
|
+
'content-type': 'application/x-www-form-urlencoded',
|
|
130
|
+
accept: 'application/json',
|
|
131
|
+
origin: config.origin
|
|
132
|
+
},
|
|
129
133
|
body: new URLSearchParams(parameters)
|
|
130
134
|
});
|
|
131
135
|
const payload = await response.json().catch(() => ({}));
|
|
@@ -290,7 +294,10 @@ export async function logout() {
|
|
|
290
294
|
const config = oauthConfig();
|
|
291
295
|
await fetch(config.revocationEndpoint, {
|
|
292
296
|
method: 'POST',
|
|
293
|
-
headers: {
|
|
297
|
+
headers: {
|
|
298
|
+
'content-type': 'application/x-www-form-urlencoded',
|
|
299
|
+
origin: config.origin
|
|
300
|
+
},
|
|
294
301
|
body: new URLSearchParams({
|
|
295
302
|
token: stored.refreshToken,
|
|
296
303
|
token_type_hint: 'refresh_token',
|