diff --git a/alkatorapi/views.py b/alkatorapi/views.py index dc233fd..c8d8db4 100644 --- a/alkatorapi/views.py +++ b/alkatorapi/views.py @@ -1,6 +1,7 @@ from django.shortcuts import render from django.http import HttpResponse from django.template.response import TemplateResponse +from django.shortcuts import redirect from django.views.decorators.csrf import csrf_exempt from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.models import User as DjangoUser @@ -64,6 +65,7 @@ def login(request): @csrf_exempt def logout(request): auth_logout(request) + return redirect("/#") @csrf_exempt diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index 4b9df2a..2681f5d 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -169,6 +169,11 @@ class Main extends Component { Přihlašování } + {Object.keys(this.state.login_status) && +