server: fix user deletes being stuck in queue
Some checks failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
Some checks failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
The user was already deleted from the user cache, so requesting the user returned null. Because the key was not null, there was a non-null return, in turn making further code think, fetching the user was successful.
This commit is contained in:
parent
4b121e7615
commit
5636534d03
|
@ -35,10 +35,9 @@ export async function authUserFromKeyId(keyId: string): Promise<AuthUser | null>
|
||||||
return await publicKeyCache.fetch(keyId)
|
return await publicKeyCache.fetch(keyId)
|
||||||
.then(async key => {
|
.then(async key => {
|
||||||
if (!key) return null;
|
if (!key) return null;
|
||||||
else return {
|
const user = await userByIdCache.fetch(key.userId);
|
||||||
user: await userByIdCache.fetch(key.userId),
|
if (!user) return null;
|
||||||
key,
|
return { user, key };
|
||||||
};
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue