0.0.10 update registrarion and login form

This commit is contained in:
2023-07-11 15:58:05 +03:00
parent ca48a00196
commit 178c5c5b7d
9 changed files with 110 additions and 45 deletions

View File

@@ -0,0 +1,25 @@
function SendLoginForm(el){
event.preventDefault()
let form = el.form;
let formData = new FormData(form);
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/ru/user_account/login/',
type: "POST",
// async: true,
cache: false,
processData: false,
contentType: false,
// enctype: 'json',
data: formData,
success: function(data){
location.href = '/profile'
},
error: function (data, exception){
document.querySelector(".login").innerHTML = data.responseJSON.html
}
});
}

View File

@@ -15,7 +15,7 @@ function SendRegistrationForm(el){
data: formData,
success: function(data){
// location.href = '/'
location.href = '/profile'
},
error: function (data, exception){
document.querySelector(".register").innerHTML = data.responseJSON.html