mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-12-15 08:32:48 +00:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bef329298a | ||
|
|
fb634dca4c | ||
|
|
b045a64496 | ||
|
|
77e471022f | ||
|
|
25987545db | ||
|
|
6720ecc6e0 | ||
|
|
0b3a7bb020 | ||
|
|
56373e362b | ||
|
|
02fc045370 | ||
|
|
e4ac73896f | ||
|
|
1518f792d6 | ||
|
|
67277dd622 | ||
|
|
82e7f020ea | ||
|
|
f20b9e01ab | ||
|
|
8cf8a3701b | ||
|
|
7ba24293d1 | ||
|
|
f10114c9ed | ||
|
|
cf31cbfb07 | ||
|
|
0edad24d5d | ||
|
|
1f1c1a9157 | ||
|
|
6c9d271ae1 | ||
|
|
6ff852e225 | ||
|
|
baa75dc735 | ||
|
|
8a9f0436b8 | ||
|
|
a9620a3cbe | ||
|
|
769e7dc8a0 | ||
|
|
2a70449411 | ||
|
|
8df720f19e | ||
|
|
dabbb45f6e | ||
|
|
ce24c1c3fd | ||
|
|
3c54c82ce9 |
@@ -24,6 +24,7 @@ ENV LANG=en_US.UTF-8 \
|
|||||||
PATH=/opt/py3/bin:$PATH
|
PATH=/opt/py3/bin:$PATH
|
||||||
|
|
||||||
ARG DEPENDENCIES=" \
|
ARG DEPENDENCIES=" \
|
||||||
|
libldap2-dev \
|
||||||
libx11-dev"
|
libx11-dev"
|
||||||
|
|
||||||
ARG TOOLS=" \
|
ARG TOOLS=" \
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#retry_button').on('click', function () {
|
$('#retry_button').on('click', function () {
|
||||||
window.location.href = "{% url 'authentication:login-face-capture' %}";
|
window.location.href = "{{ request.get_full_path }}";
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from django.test import TestCase
|
|||||||
|
|
||||||
# Create your tests here.
|
# Create your tests here.
|
||||||
|
|
||||||
|
|
||||||
from .utils import random_string, signer
|
from .utils import random_string, signer
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,24 +27,31 @@ class UserFaceCaptureView(AuthMixin, FormView):
|
|||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data()
|
context = super().get_context_data(**kwargs)
|
||||||
|
|
||||||
if not self.get_form().is_bound:
|
if 'form' not in kwargs:
|
||||||
|
form = self.get_form()
|
||||||
|
context['form'] = form
|
||||||
|
|
||||||
|
if not context['form'].is_bound:
|
||||||
context.update({
|
context.update({
|
||||||
"active": True,
|
"active": True,
|
||||||
})
|
})
|
||||||
|
|
||||||
kwargs.update(context)
|
return context
|
||||||
return kwargs
|
|
||||||
|
|
||||||
|
|
||||||
class UserFaceEnableView(UserFaceCaptureView, MFAFaceMixin):
|
class UserFaceEnableView(MFAFaceMixin, UserFaceCaptureView):
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
code = self.get_face_code()
|
|
||||||
|
|
||||||
user = self.get_user_from_session()
|
try:
|
||||||
user.face_vector = code
|
code = self.get_face_code()
|
||||||
user.save(update_fields=['face_vector'])
|
user = self.get_user_from_session()
|
||||||
|
user.face_vector = code
|
||||||
|
user.save(update_fields=['face_vector'])
|
||||||
|
except Exception as e:
|
||||||
|
form.add_error("code", str(e))
|
||||||
|
return super().form_invalid(form)
|
||||||
|
|
||||||
auth_logout(self.request)
|
auth_logout(self.request)
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|||||||
Reference in New Issue
Block a user