Middleware
hypha.apply.users.middleware
¶
TWO_FACTOR_EXEMPTED_PATH_PREFIXES
module-attribute
¶
TWO_FACTOR_EXEMPTED_PATH_PREFIXES = ['/auth/', '/login/', '/logout/', '/account/', '/apply/submissions/success/']
SocialAuthExceptionMiddleware
¶
Bases: SocialAuthExceptionMiddleware
Wrapper around SocialAuthExceptionMiddleware to customise messages
TwoFactorAuthenticationMiddleware
¶
Middleware to enforce 2FA activation for unverified users
To activate this middleware set env variable ENFORCE_TWO_FACTOR as True.
This will redirect all request from unverified users to enable 2FA first. Except the request made on the url paths listed in TWO_FACTOR_EXEMPTED_PATH_PREFIXES.