mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-04 08:13:38 +00:00
captcha: Fix issue with captcha path when captcha entered is wrong
Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
62f26433e8
commit
6e26c92441
@ -244,6 +244,7 @@ def configure_django():
|
||||
CACHES={'default':
|
||||
{'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}},
|
||||
CAPTCHA_FONT_PATH=['/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf'],
|
||||
CAPTCHA_LENGTH=6,
|
||||
DATABASES={'default':
|
||||
{'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': cfg.store_file}},
|
||||
|
||||
@ -62,7 +62,8 @@ class SSOLoginView(LoginView):
|
||||
if request.user.is_authenticated:
|
||||
return set_ticket_cookie(request.user, response)
|
||||
else: # Redirect user to captcha page
|
||||
return HttpResponseRedirect('captcha')
|
||||
redirect = '' if request.path.rstrip('/').endswith('captcha') else 'captcha'
|
||||
return HttpResponseRedirect(redirect)
|
||||
return response
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user