added web and fix some problems
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 9s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 14s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Failing after 8s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 9s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 14s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Failing after 8s
This commit is contained in:
1 parent
ccfc8b535e
commit
155c259ea9
29 files changed
+946
-119
No files matched your search
@@ -0,0 +1,34 @@
|
||||
const changepasswordform = document.querySelector('.changepasswordform')
|
||||
const cancelchangepassword = document.querySelector('#cancelchangepassword')
|
||||
const changepasswordformbody = document.querySelector('.changepasswordformbody')
|
||||
const changepasswordnewpassword = document.querySelector('#changepasswordnewpassword')
|
||||
|
||||
let changepassuserid = "";
|
||||
|
||||
const change_password = (userid) => {
|
||||
changepasswordform.classList.add('active')
|
||||
changepassuserid = userid
|
||||
}
|
||||
|
||||
cancelchangepassword.addEventListener('click', e => {
|
||||
e.preventDefault()
|
||||
changepasswordform.classList.remove('active')
|
||||
})
|
||||
|
||||
changepasswordformbody.addEventListener('submit', async e => {
|
||||
e.preventDefault()
|
||||
const hashedpassword = await hashPassword(changepasswordnewpassword.value)
|
||||
const status = await fetch(routes.change_password_url(), {
|
||||
method: 'POST',
|
||||
body: `{"token":"${localStorage.getItem('token')}","userid":${changepassuserid},"new_password":"${hashedpassword}"}`
|
||||
}).then(data => data.json()).then(jsondata => jsondata).catch((error) => {
|
||||
notification(`Ошибка на сервере: ${error}`, "error")
|
||||
})
|
||||
if (!status.error) {
|
||||
notification("Пароль успешно изменен", "success")
|
||||
changepasswordform.classList.remove('active')
|
||||
changepasswordnewpassword.value = ""
|
||||
} else {
|
||||
notification(status.error, "error")
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user