mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 17:04:49 +08:00
Fix (#2641)
This commit is contained in:
parent
97f6a4ff8e
commit
6645c2d4bd
1 changed files with 5 additions and 0 deletions
|
@ -154,6 +154,11 @@ async function authenticateWithApeKey(
|
|||
|
||||
const keyOwner = (await UsersDAO.getUser(uid)) as MonkeyTypes.User;
|
||||
const targetApeKey = _.get(keyOwner.apeKeys, keyId);
|
||||
|
||||
if (!targetApeKey.enabled) {
|
||||
throw new MonkeyError(400, "ApeKey is disabled");
|
||||
}
|
||||
|
||||
const isKeyValid = await compare(apeKey, targetApeKey?.hash);
|
||||
|
||||
if (!isKeyValid) {
|
||||
|
|
Loading…
Reference in a new issue