fix(web): fix authorization

This commit is contained in:
Masahiko AMANO 2023-01-31 15:28:28 +03:00
parent 0c03d3a791
commit c62d5fa512

View File

@ -99,9 +99,9 @@ func HandlerAuth(w http.ResponseWriter, r *http.Request) {
}
}
hash = sha256.Sum256(buffer[:passlen])
TokenGenerate(buffer)
if bytes.Equal(hash[:], passhash) {
log.Println("Password valid")
TokenGenerate(buffer)
response.Status = true
response.Token = TOKEN
http.SetCookie(w, &http.Cookie{