mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-01 15:37:19 +00:00
fix: 配置仅已存在用户登录后 cas用户首次登录报403 (#8752)
Co-authored-by: feng626 <1304903146@qq.com>
This commit is contained in:
15
apps/authentication/backends/cas/views.py
Normal file
15
apps/authentication/backends/cas/views.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from django_cas_ng.views import LoginView
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.http import HttpResponseRedirect
|
||||
|
||||
__all__ = ['LoginView']
|
||||
|
||||
|
||||
class CASLoginView(LoginView):
|
||||
def get(self, request):
|
||||
try:
|
||||
return super().get(request)
|
||||
except PermissionDenied:
|
||||
return HttpResponseRedirect('/')
|
||||
|
||||
|
Reference in New Issue
Block a user