added get_ssh_server and set_ssh_server
This commit is contained in:
1 parent
f7b1d75bab
commit
5a1a3a92a2
10 files changed
+133
-3
No files matched your search
+12
-1
@@ -6,6 +6,15 @@ const exitbutton = document.querySelector('.exitbutton')
|
||||
const adminpanelsection = document.querySelector('.adminpanel')
|
||||
const headerusername = document.querySelector('.headerusername')
|
||||
|
||||
const hashPassword = async (password) => {
|
||||
const encoder = new TextEncoder()
|
||||
const data = encoder.encode(password)
|
||||
const hashBuffer = await crypto.subtle.digest('SHA-256', data)
|
||||
const hashArray = Array.from(new Uint8Array(hashBuffer))
|
||||
const hashHex = hashArray.map(b=>('00' + b.toString(16)).slice(-2)).join('')
|
||||
return hashHex
|
||||
}
|
||||
|
||||
if (localStorage.getItem("token") === null) {
|
||||
adminpanelsection.classList.remove('active')
|
||||
loginform.classList.add('active')
|
||||
@@ -17,7 +26,9 @@ if (localStorage.getItem("token") === null) {
|
||||
|
||||
loginformbody.addEventListener('submit', (e) => {
|
||||
e.preventDefault()
|
||||
login(loginusername.value, loginpassword.value)
|
||||
hashPassword(loginpassword.value).then(hashedpassword => {
|
||||
login(loginusername.value, hashedpassword)
|
||||
})
|
||||
})
|
||||
|
||||
const login = async (username, password) => {
|
||||
|
||||
Reference in new issue
Block a user