mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
return UserNotFound error if user does not exist in delete account trx
This commit is contained in:
parent
7d7b51500c
commit
e5d6386b96
1 changed files with 7 additions and 1 deletions
|
|
@ -368,7 +368,13 @@ export const deleteAccountResolver = authorized<
|
|||
>(async (_, { userID }, { models, claims, log, authTrx }) => {
|
||||
const user = await models.user.get(userID)
|
||||
|
||||
if (!user || user.id !== claims.uid) {
|
||||
if (!user) {
|
||||
return {
|
||||
errorCodes: [DeleteAccountErrorCode.UserNotFound],
|
||||
}
|
||||
}
|
||||
|
||||
if (user.id !== claims.uid) {
|
||||
return {
|
||||
errorCodes: [DeleteAccountErrorCode.Unauthorized],
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue