Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Some simple AJAX authorisation endpoints for Django.
I wanted a package to integrate AJAX authorisation with Django's standard authorisation views. When a request is made via AJAX it should be handled as such, and when a standard request is made the login form should be rendered.
pip
is the easiest way to get the package:
pip install django-ajax-auth
Add the package to your Django settings file:
INSTALLED_APPS = [
'xauth',
...
]
Replace the standard authorisation URLs in your URL configuration:
urlpatterns = [
url(r'^', include('xauth.login_ajax_urls'))
]
Now you can either perform the usual non-AJAX GET and POST to login
as you would normally, or POST using application/json
encoding to
login over AJAX.
import $ from 'jquery'
$.ajax({
url: '/login',
method: 'POST',
contentType: 'application/json',
data: {
username: 'harry',
password: 'henderson123'
}
})
Sometimes you may wish to only allow AJAX logins, in which case set
XAUTH_AJAX
to True
in your settings file.
FAQs
A simple Django application for AJAX authorisation.
We found that django-ajax-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.