error in rfc6750

This commit is contained in:
Kagami Sascha Rosylight
2023-06-22 01:25:40 +02:00
parent ecdd1c115a
commit 1567a2ea3e
2 changed files with 14 additions and 10 deletions

View File

@@ -471,7 +471,7 @@ describe('OAuth', () => {
},
body: JSON.stringify({ text: 'test' }),
});
assert.strictEqual(createResponse2.status, 403);
assert.strictEqual(createResponse2.status, 401);
});
});
@@ -659,10 +659,7 @@ describe('OAuth', () => {
// "The access token provided is expired, revoked, malformed, or
// invalid for other reasons. The resource SHOULD respond with
// the HTTP 401 (Unauthorized) status code."
// (but it's SHOULD not MUST. 403 should be okay for now.)
assert.strictEqual(createResponse.status, 403);
// TODO: error code (wrong Authorization header should emit OAuth error instead of Misskey API error)
await assertDirectError(createResponse as Response, 401, 'invalid_token');
});
// https://datatracker.ietf.org/doc/html/rfc6749.html#section-3.1.2.4