login page

This commit is contained in:
Nazar Kanaev
2020-11-03 21:54:55 +00:00
parent 94d1659ad5
commit 0e2da62081
5 changed files with 104 additions and 3 deletions

22
server/auth.go Normal file
View File

@@ -0,0 +1,22 @@
package server
import (
"net/http"
)
func userIsAuthenticated(req *http.Request, username, password string) bool {
cookie, _ := req.Cookie("auth")
if cookie == nil {
return false
}
// TODO: change to something sane
if cookie.Value != username {
return false
}
return true
}
func userAuthenticate(rw http.ResponseWriter, username, password string) {
}