Compare commits
2 Commits
ac2600c21c
...
69c6569a0d
Author | SHA1 | Date |
---|---|---|
leah | 69c6569a0d | |
leah | 431bbecfda |
|
@ -18,6 +18,7 @@
|
|||
# sensitive data that shouldn't be pushed
|
||||
data/
|
||||
config.yml
|
||||
*.log
|
||||
|
||||
# build bits
|
||||
resources/build/
|
5
go.mod
5
go.mod
|
@ -2,4 +2,7 @@ module tildegit.org/southlondon/admin
|
|||
|
||||
go 1.17
|
||||
|
||||
require gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||
require (
|
||||
github.com/google/uuid v1.3.0
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||
)
|
||||
|
|
2
go.sum
2
go.sum
|
@ -1,3 +1,5 @@
|
|||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
|
|
8
main.go
8
main.go
|
@ -125,6 +125,14 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func loginHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// userid, err := r.Cookie("user-id")
|
||||
// if err != nil {
|
||||
// useridbody := uuid.New()
|
||||
// expiration := time.Now().Add(365 * 24 * time.Hour)
|
||||
// cookie := http.Cookie{Name: "user-id", Value: useridbody.String(), Expires: expiration}
|
||||
// http.SetCookie(w, &cookie)
|
||||
// }
|
||||
|
||||
switch r.URL.Path {
|
||||
case "/login", "/login/":
|
||||
http.Redirect(w, r, requesturl, http.StatusFound)
|
||||
|
|
Reference in New Issue