added new basic auth endpoint

This commit is contained in:
ston1th 2022-08-21 14:59:31 +02:00
commit 8c9ab3b8d2
10 changed files with 249 additions and 51 deletions

View file

@ -7,11 +7,10 @@ import (
"time"
)
func validatePassword(pw string) (b []byte) {
func validatePassword(pw string) []byte {
hash := sha256.New()
hash.Write(b)
b = hash.Sum(nil)
return
hash.Write([]byte(pw))
return hash.Sum(nil)
}
const timeFmt = "2006-01-02 15:04:05"