login page
This commit is contained in:
parent
94d1659ad5
commit
0e2da62081
5 changed files with 104 additions and 3 deletions
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) {
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue