Compare commits

...

2 Commits

Author SHA1 Message Date
leah 69c6569a0d some cookie bits 2022-01-28 00:28:37 +00:00
leah 431bbecfda exclude logfile 2022-01-27 23:20:16 +00:00
4 changed files with 15 additions and 1 deletions

1
.gitignore vendored
View File

@ -18,6 +18,7 @@
# sensitive data that shouldn't be pushed
data/
config.yml
*.log
# build bits
resources/build/

5
go.mod
View File

@ -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
View File

@ -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=

View File

@ -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)