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

Do not throw ImproperlyConfigured error when custom Verify middleware is used

robmoorman opened this issue · comments

In order to use additional rules for verification (e.g. specify which user groups need 2fa), this line breaks custom middleware core.

Maybe better option to move this to the docs as an important rule that middleware is required, rather than at runtime when he app is loaded.

raise ImproperlyConfigured(
"Please add 'wagtail_2fa.middleware.VerifyUserMiddleware' "
"to django.conf.settings.MIDDLEWARE"
)

This was fixed in pull request #31. It's now possible to use custom verify middleware. The exception is no longer raised, instead it's noted in the docs that the middleware has to be used.

Great @nnist !

Fantastic, thank you.