mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-13 01:38:29 +03:00
Merge tag 'release/v2.1.8' into develop
Fix urgent OAuth2 bug.
This commit is contained in:
@@ -7,6 +7,8 @@ const router: Router = Router({ mergeParams: true });
|
||||
/**
|
||||
* Returns Tachi Configuration info, such as server name, type, supported games
|
||||
* and more.
|
||||
*
|
||||
* @name GET /api/v1/config
|
||||
*/
|
||||
router.get("/", (req, res) =>
|
||||
res.status(200).json({
|
||||
|
||||
@@ -32,6 +32,10 @@ t.test("POST /api/v1/oauth/token", (t) => {
|
||||
"Should assign the permissions this client has configured."
|
||||
);
|
||||
|
||||
const exists = await db["oauth2-auth-codes"].findOne({ code: "AUTH_CODE" });
|
||||
|
||||
t.equal(exists, null, "Should remove the code from the database after being used.");
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
||||
@@ -67,6 +67,9 @@ router.post(
|
||||
});
|
||||
}
|
||||
|
||||
// don't let people auth with the same code multiple times.
|
||||
await db["oauth2-auth-codes"].remove({ code: req.body.code });
|
||||
|
||||
const apiDoc = {
|
||||
userID: codeDoc.userID,
|
||||
token: Random20Hex(),
|
||||
|
||||
Reference in New Issue
Block a user