Task "users:disable_2fa" does not disable security keys

If the user has security keys, they are not deleted, so the user still can’t log in.

Unless UserSecondFactor is broken somehow, which seems unlikely, the security keys also need to be deleted, something like this:

UserSecurityKey.where(user_id: user.id).destroy_all
2개의 좋아요

Sure seems like a reasonable improvement to the task, can you send a PR?

1개의 좋아요

If it were just just one line I’d have done it already, but I’ll really need to create a test or two, which is more daunting (and 4 the work!)

But maybe I can be a big boy.

Just one test that creates a 2fa key and then makes sure it gets cleared? And I guess there’s coffee to create a dummy key in the 2fa code somewhere?

2개의 좋아요

Well, it doesn’t seem that there are any specs for this take task, so it’s just the single line:

https://github.com/discourse/discourse/pull/20586

1개의 좋아요

This topic was automatically closed after 4 days. New replies are no longer allowed.