Add: Redirect logged in users to homepage

This commit is contained in:
Aroy-Art 2023-10-20 16:27:39 +02:00
parent c4dfd547de
commit 8318750eb0
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -5,6 +5,10 @@ from .forms import LoginForm, SignUpForm
def login_view(request): def login_view(request):
if request.user.is_authenticated:
# User is already logged in, redirect them to the home page
return redirect('/')
form = LoginForm(request.POST or None) form = LoginForm(request.POST or None)
msg = None msg = None