mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
Default to session authentication if logged in
This commit is contained in:
parent
cade72e80e
commit
d911e81113
|
@ -273,8 +273,9 @@ body {
|
|||
}
|
||||
|
||||
.api-modal .modal-body .request-awaiting {
|
||||
text-align: center;
|
||||
padding: 35px 10px;
|
||||
color: #7F8177;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.api-modal .modal-body .meta {
|
||||
|
|
|
@ -76,6 +76,15 @@
|
|||
const schema = {{ schema }}
|
||||
const doc = codec.decode(schema)
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
window.auth = {
|
||||
'type': 'session',
|
||||
};
|
||||
$('#selected-authentication').text('session');
|
||||
$('#auth-control').children().removeClass('active');
|
||||
$('#auth-control').find("[data-auth='session']").addClass('active');
|
||||
{% endif %}
|
||||
|
||||
// Language Control
|
||||
$('#language-control li').click(function (event) {
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue
Block a user