summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
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)