yarr/server/auth.go
2020-11-03 21:54:55 +00:00

23 lines
369 B
Go

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) {
}