From 5c0a901b1b3e522ed523e966feb9901b8c7e01ff Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Fri, 30 Aug 2013 11:46:22 +0200 Subject: Login implemented --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 4eb58c2..8af1fc1 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,8 @@ import ( "flag" "fmt" "github.com/gorilla/mux" + "github.com/gorilla/securecookie" + "github.com/gorilla/sessions" "github.com/kch42/simpleconf" _ "kch42.de/gostuff/mailremind/model/mysql" "log" @@ -17,6 +19,8 @@ func debug(rw http.ResponseWriter, req *http.Request) { var conf simpleconf.Config var baseurl string +var SessionStorage = sessions.NewCookieStore(securecookie.GenerateRandomKey(32), securecookie.GenerateRandomKey(32)) + func main() { confpath := flag.String("config", "", "Path to config file") flag.Parse() @@ -51,6 +55,8 @@ func main() { router.PathPrefix("/static").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(staticpath)))) router.HandleFunc("/register", register) router.HandleFunc("/activate", activate) + router.HandleFunc("/login", login) + router.HandleFunc("/logincheck", logincheck) http.Handle("/", router) -- cgit v1.2.3-70-g09d2