fix(web): fix authorization
This commit is contained in:
parent
0c03d3a791
commit
c62d5fa512
@ -99,9 +99,9 @@ func HandlerAuth(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
hash = sha256.Sum256(buffer[:passlen])
|
hash = sha256.Sum256(buffer[:passlen])
|
||||||
TokenGenerate(buffer)
|
|
||||||
if bytes.Equal(hash[:], passhash) {
|
if bytes.Equal(hash[:], passhash) {
|
||||||
log.Println("Password valid")
|
log.Println("Password valid")
|
||||||
|
TokenGenerate(buffer)
|
||||||
response.Status = true
|
response.Status = true
|
||||||
response.Token = TOKEN
|
response.Token = TOKEN
|
||||||
http.SetCookie(w, &http.Cookie{
|
http.SetCookie(w, &http.Cookie{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user