mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Login redirect fix
This commit is contained in:
parent
e683912561
commit
d9f621c922
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user