mirror of
https://github.com/nkanaev/yarr.git
synced 2025-12-15 08:37:21 +00:00
login page
This commit is contained in:
22
server/auth.go
Normal file
22
server/auth.go
Normal 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) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user