Skip to content

Fix: disabling WebAuthn 404s — DELETE /2factor/authn is not registered - #125

Open
palmoni5 wants to merge 1 commit into
NodeBB:masterfrom
palmoni5:fix/authn-disable-route
Open

Fix: disabling WebAuthn 404s — DELETE /2factor/authn is not registered#125
palmoni5 wants to merge 1 commit into
NodeBB:masterfrom
palmoni5:fix/authn-disable-route

Conversation

@palmoni5

Copy link
Copy Markdown

The Disable button on the account 2factor page (static/templates/account/2factor.tpl, data-action="disableAuthn") calls api.del('/plugins/2factor/authn'), but only /2factor/authn/register, /devices, /device, /device/:id and /verify are registered — there is no bare DELETE /2factor/authn. The request 404s and users cannot remove WebAuthn wholesale.

This registers the missing route, backed by a new plugin.removeAllDevices(uid) helper that clears all WebAuthn keys, their names, and their counters for the user. plugin.disassociate previously inlined the same key-clearing logic and now reuses the helper.

The 'Disable' button on the account 2factor page calls
DELETE /api/v3/plugins/2factor/authn, but no such route was
registered, so the request 404'd and users could not remove WebAuthn
wholesale. Add the route, backed by a removeAllDevices helper that
disassociate() now reuses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant