mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 09:06:40 +03:00
Added logout functionality to demo project
This commit is contained in:
parent
7c8a34f700
commit
8d91e1881e
|
@ -11,6 +11,8 @@ urlpatterns = [
|
|||
name='email-verification'),
|
||||
url(r'^login/$', TemplateView.as_view(template_name="login.html"),
|
||||
name='login'),
|
||||
url(r'^logout/$', TemplateView.as_view(template_name="logout.html"),
|
||||
name='logout'),
|
||||
url(r'^password-reset/$',
|
||||
TemplateView.as_view(template_name="password_reset.html"),
|
||||
name='password-reset'),
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
<li class="divider"></li>
|
||||
<!-- these pages require user token -->
|
||||
<li><a href="{% url 'user-details' %}">User details</a></li>
|
||||
<li><a href="{% url 'logout' %}">Logout</a></li>
|
||||
<li><a href="{% url 'password-change' %}">Password change</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
20
demo/templates/fragments/logout_form.html
Normal file
20
demo/templates/fragments/logout_form.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% block content %}
|
||||
|
||||
<form class="form-horizontal ajax-post" role="form" action="{% url 'rest_logout' %}">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label for="token" class="col-sm-2 control-label">User Token</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="token" type="text" class="form-control" id="token" placeholder="Token">
|
||||
<p class="help-block">Token received after login</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-default">Login</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group api-response"></div>
|
||||
</form>
|
||||
{% endblock %}
|
8
demo/templates/logout.html
Normal file
8
demo/templates/logout.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<h3>Logout</h3><hr/>
|
||||
{% include "fragments/logout_form.html" %}
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user