mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
23 lines
369 B
Go
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) {
|
|
|
|
}
|