mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
fix: redirect to home after login if next is not set
This commit is contained in:
parent
a5512dd4c4
commit
826ffc8ba9
@ -53,6 +53,9 @@ class LoginView(View):
|
||||
redirect_to = request.POST.get('next')
|
||||
if redirect_to and not is_safe_url(url=redirect_to, allowed_hosts=request.get_host()):
|
||||
logger.warning(f"Ignoring unsafe 'next' URL passed to login form: {redirect_to}")
|
||||
redirect_to = None
|
||||
# Default to homepage
|
||||
if not redirect_to:
|
||||
redirect_to = reverse('home')
|
||||
|
||||
# If maintenance mode is enabled, assume the database is read-only, and disable updating the user's
|
||||
|
Loading…
Reference in New Issue
Block a user