odhlašování
This commit is contained in:
parent
ccf234444b
commit
1eeba8ec14
@ -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
|
||||
|
@ -169,6 +169,11 @@ class Main extends Component {
|
||||
<a class="nav-link" href="#login">Přihlašování</a>
|
||||
</li>
|
||||
}
|
||||
{Object.keys(this.state.login_status) &&
|
||||
<li>
|
||||
Přihlášen {this.state.login_status.first_name} {this.state.login_status.last_name} <a href="/api/logout">Odhlásit</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
Loading…
x
Reference in New Issue
Block a user