labd / wagtail-2fa

2 Factor Authentication for Wagtail

Home Page:https://wagtail-2fa.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom permission middleware removes Enable 2fa from group permissions

martinjobb opened this issue · comments

Thanks for a great app!

I needed to extend wagtail_2fa.middleware.VerifyUserPermissionsMiddleware to make it work in a headless context and it made the register_permissions hook not fire.

I think it's this line https://github.com/labd/wagtail-2fa/blob/master/src/wagtail_2fa/wagtail_hooks.py#L72.

I implemented a custom hook that did basically the same thing, but it would be nice if possible to make a more generic check.