add logout, primarily\ for dev purposes
This commit is contained in:
parent
5b98daba9a
commit
4125256601
|
@ -5,4 +5,5 @@ from . import views
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', views.index, name='index'),
|
path('', views.index, name='index'),
|
||||||
path('login/<slug:token>', views.login, name='token_login'),
|
path('login/<slug:token>', views.login, name='token_login'),
|
||||||
|
path('logout', views.logout, name='token_logout'),
|
||||||
]
|
]
|
||||||
|
|
|
@ -19,4 +19,8 @@ def login(request, token):
|
||||||
tk.helper.number_validated=True
|
tk.helper.number_validated=True
|
||||||
tk.helper.save()
|
tk.helper.save()
|
||||||
request.session['token'] = token
|
request.session['token'] = token
|
||||||
|
return redirect('index')
|
||||||
|
|
||||||
|
def logout(request):
|
||||||
|
del request.session['token']
|
||||||
return redirect('index')
|
return redirect('index')
|
Loading…
Reference in New Issue