mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 05:20: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 {
|
.api-modal .modal-body .request-awaiting {
|
||||||
text-align: center;
|
|
||||||
padding: 35px 10px;
|
padding: 35px 10px;
|
||||||
|
color: #7F8177;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.api-modal .modal-body .meta {
|
.api-modal .modal-body .meta {
|
||||||
|
|
|
@ -76,6 +76,15 @@
|
||||||
const schema = {{ schema }}
|
const schema = {{ schema }}
|
||||||
const doc = codec.decode(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
|
||||||
$('#language-control li').click(function (event) {
|
$('#language-control li').click(function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user