This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2018-12-14 12:51:12 +00:00
|
|
|
"""passbook captcha factor"""
|
|
|
|
|
|
|
|
from django.views.generic import FormView
|
|
|
|
|
|
|
|
from passbook.captcha_factor.forms import CaptchaForm
|
|
|
|
from passbook.core.auth.factor import AuthenticationFactor
|
2019-02-16 08:52:37 +00:00
|
|
|
from passbook.core.auth.factor_manager import MANAGER
|
2018-12-14 12:51:12 +00:00
|
|
|
|
|
|
|
|
2019-02-16 08:52:37 +00:00
|
|
|
@MANAGER.factor()
|
2018-12-14 12:51:12 +00:00
|
|
|
class CaptchaFactor(FormView, AuthenticationFactor):
|
|
|
|
"""Simple captcha checker, logic is handeled in django-captcha module"""
|
|
|
|
|
|
|
|
form_class = CaptchaForm
|
|
|
|
|
|
|
|
def form_valid(self, form):
|
|
|
|
return self.authenticator.user_ok()
|