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
1 changed files with 3 additions and 4 deletions
|
@ -35,10 +35,9 @@ export async function authUserFromKeyId(keyId: string): Promise<AuthUser | null>
|
|||
return await publicKeyCache.fetch(keyId)
|
||||
.then(async key => {
|
||||
if (!key) return null;
|
||||
else return {
|
||||
user: await userByIdCache.fetch(key.userId),
|
||||
key,
|
||||
};
|
||||
const user = await userByIdCache.fetch(key.userId);
|
||||
if (!user) return null;
|
||||
return { user, key };
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue