Skip to content

Commit

Permalink
fix(app): #19 logout is not allowed using get request (#20)
Browse files Browse the repository at this point in the history
Logging out via GET requests to the built-in logout view is deprecated. Use POST requests instead.
  • Loading branch information
aksharahegde authored Jan 15, 2024
1 parent e4f4314 commit c041bc3
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 18 deletions.
20 changes: 20 additions & 0 deletions jet/static/jet/css/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,23 @@ input[type=checkbox] {
.selector {
display: none;
}


#logout-form {
display: inline;
button {
display: block;
line-height: 30px;
line-height: 2.14286rem;
padding: 0 14px;
padding: 0 1rem;
color: #fff;
text-decoration: none;
background: transparent;
border: none;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
}
2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/default/base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/default/base.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/green/base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/green/base.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/light-blue/base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/light-blue/base.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/light-gray/base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/light-gray/base.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/light-green/base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/light-green/base.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/light-violet/base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/light-violet/base.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/primary/base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/css/themes/primary/base.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/js/build/bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jet/static/jet/js/src/layout-updaters/user-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ UserToolsUpdater.prototype = {
}
});

$usertools.find('a').each(function() {
$usertools.find('a, #logout-form').each(function() {
var $link = $(this);
$('<li>').addClass('user-tools-link').html($link).appendTo($list);
});
Expand Down
5 changes: 4 additions & 1 deletion jet/templates/admin/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@
{% if user.has_usable_password %}
<a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
{% endif %}
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
<form id="logout-form" method="post" action="{% url 'admin:logout' %}">
{% csrf_token %}
<button type="submit">{% translate "Log out" %}</button>
</form>
{% endblock %}
</div>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_install_requires():

setup(
name='django-jet-calm',
version='5.3.0',
version='5.3.1',
description='Modern template for Django-4 admin interface with improved functionality',
long_description=read('README.rst'),
author='Akshara Hegde',
Expand Down

0 comments on commit c041bc3

Please sign in to comment.