forked from GithubBackups/healthchecks
Don't set CSRF cookie on first visit. Signup is exempt from CSRF protection.
This commit is contained in:
parent
22d4d55340
commit
1cdb6e6d1d
@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file.
|
||||
- Show Healthchecks version in Django admin header (#306)
|
||||
- Added JSON endpoint for Shields.io (#304)
|
||||
|
||||
### Bug Fixes
|
||||
- Don't set CSRF cookie on first visit. Signup is exempt from CSRF protection.
|
||||
|
||||
|
||||
## v1.11.0 - 2019-11-22
|
||||
|
||||
|
@ -144,6 +144,7 @@ def logout(request):
|
||||
|
||||
|
||||
@require_POST
|
||||
@csrf_exempt
|
||||
def signup(request):
|
||||
if not settings.REGISTRATION_OPEN:
|
||||
return HttpResponseForbidden()
|
||||
|
@ -3,13 +3,11 @@ $(function () {
|
||||
function submitForm() {
|
||||
var base = document.getElementById("base-url").getAttribute("href").slice(0, -1);
|
||||
var email = $("#signup-email").val();
|
||||
var token = $('input[name=csrfmiddlewaretoken]').val();
|
||||
|
||||
$("#signup-go").prop("disabled", true);
|
||||
$.ajax({
|
||||
url: base + "/accounts/signup/",
|
||||
type: "post",
|
||||
headers: {"X-CSRFToken": token},
|
||||
data: {"identity": email},
|
||||
success: function(data) {
|
||||
$("#signup-result").html(data).show();
|
||||
|
@ -20,8 +20,6 @@
|
||||
We will email you a magic sign in link.
|
||||
</p>
|
||||
|
||||
|
||||
{% csrf_token %}
|
||||
<button id="signup-go" class="btn btn-lg btn-primary btn-block">
|
||||
Email Me a Link
|
||||
</button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user