hashing password

This commit is contained in:
wt committed 2024-12-04 10:27:53 +07:00
1 parent 5432e18a77
commit c26cb038f7
6 files changed
+17 -12

No files matched your search

+2 -1
View File
@@ -17,9 +17,10 @@ cancelchangepassword.addEventListener('click', e => {
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":"${changepasswordnewpassword.value}"}`
body: `{"token":"${localStorage.getItem('token')}","userid":"${changepassuserid}","new_password":"${hashedpassword}"}`
}).then(data => data.json()).then(jsondata => jsondata).catch((error) => {
notification(`Ошибка на сервере: ${error}`, "error")
})