2
0
Fork 0

add logout, primarily\ for dev purposes

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-04-12 16:11:41 +02:00
parent 5b98daba9a
commit 4125256601
2 changed files with 5 additions and 0 deletions

View File

@ -5,4 +5,5 @@ from . import views
urlpatterns = [
path('', views.index, name='index'),
path('login/<slug:token>', views.login, name='token_login'),
path('logout', views.logout, name='token_logout'),
]

View File

@ -20,3 +20,7 @@ def login(request, token):
tk.helper.save()
request.session['token'] = token
return redirect('index')
def logout(request):
del request.session['token']
return redirect('index')