NodeBB / NodeBB

Node.js based forum software built for the modern web
https://nodebb.org
GNU General Public License v3.0
14.21k stars 2.8k forks source link

v.1.15.2 users can't delete themselfs #8918

Closed amosin closed 3 years ago

amosin commented 3 years ago

On latest version of NodeBB 1.15.2 I am getting an exception when users is trying to delete themself. It is fine if admin deletes the users. It works fine on 1.13.x.

First: /admin/settings/user -> Allow Account Deletion = True

HERE is the exception log:

2020-11-20T00:52:12.405Z [4567/24453] - verbose: [plugins/fireHook] static:sockets.validateSession 2020-11-20T00:52:12.406Z [4567/24453] - warn: [deprecated] at SocketUser.deleteAccount (/home/username/nodebb/src/socket.io/user.js:39:10) at wrapperCallback (/home/username/nodebb/src/promisify.js:48:18) at onMessage (/home/username/nodebb/src/socket.io/index.js:136:25) use DELETE /api/v3/users/:uid/account (node:24453) UnhandledPromiseRejectionWarning: Error: [[error:no-privileges]] at processDeletion (/home/username/nodebb/src/api/users.js:248:9) at process._tickCallback (internal/process/next_tick.js:68:7) (node:24453) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:24453) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 2020-11-20T00:52:12.504Z [4567/24453] - verbose: [plugins/fireHook] filter:user.getSettings

barisusakli commented 3 years ago

@amosin thanks for reporting seems like a regression from https://github.com/NodeBB/NodeBB/pull/8881