mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Login redirect fix
This commit is contained in:
@ -78,8 +78,16 @@ class AuthRequiredMiddleware(object):
|
||||
return HttpResponseRedirect(reverse_lazy('login'))
|
||||
|
||||
login = reverse_lazy('login')
|
||||
logout = reverse_lazy('logout')
|
||||
|
||||
if not request.path_info == login and not request.path_info.startswith('/api/'):
|
||||
path = request.path_info
|
||||
|
||||
urls = [
|
||||
login,
|
||||
logout,
|
||||
]
|
||||
|
||||
if path not in urls and not path.startswith('/api/') and '/admin/logout/' not in path:
|
||||
# Save the 'next' parameter to pass through to the login view
|
||||
|
||||
return redirect('%s?next=%s' % (login, request.path))
|
||||
|
Reference in New Issue
Block a user