From 49893ffdb6915659b9e8aad0afbe4f16659c475c Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Mon, 26 Dec 2016 08:38:32 -0500 Subject: [PATCH] cleanup --- main.go | 4 ---- sessions.go | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 99feff3..b33a7a0 100644 --- a/main.go +++ b/main.go @@ -16,23 +16,19 @@ import ( var serveFcgi bool var baseDir string -var tmpDir string var port int var smtpServer string var smtpPort int var smtpUsername string var smtpPassword string -var reminderEmail string func init() { flag.StringVar(&baseDir, "base", "./", "Base directory for server") - flag.StringVar(&tmpDir, "tmp", "/tmp", "Directory to create temporary files in") flag.IntVar(&port, "port", 80, "Port to serve API/files on") flag.StringVar(&smtpServer, "smtp.server", "smtp.example.com", "SMTP server to send reminder emails from.") flag.IntVar(&smtpPort, "smtp.port", 587, "SMTP server port to connect to") flag.StringVar(&smtpUsername, "smtp.username", "moneygo", "SMTP username") flag.StringVar(&smtpPassword, "smtp.password", "password", "SMTP password") - flag.StringVar(&reminderEmail, "email", "moneygo@example.com", "Email address to send reminder emails as.") flag.BoolVar(&serveFcgi, "fcgi", false, "Serve via fcgi rather than http.") flag.Parse() diff --git a/sessions.go b/sessions.go index d3e23f8..ef50022 100644 --- a/sessions.go +++ b/sessions.go @@ -25,7 +25,7 @@ func (s *Session) Write(w http.ResponseWriter) error { func GetSession(r *http.Request) (*Session, error) { var s Session - session, _ := cookie_store.Get(r, "moneygo") + session, _ := cookie_store.Get(r, "lunch") _, ok := session.Values["session-secret"] if !ok { return nil, fmt.Errorf("session-secret cookie not set") @@ -49,7 +49,7 @@ func DeleteSessionIfExists(r *http.Request) { func NewSession(w http.ResponseWriter, r *http.Request, userid int64) (*Session, error) { s := Session{} - session, _ := cookie_store.Get(r, "moneygo") + session, _ := cookie_store.Get(r, "lunch") session.Values["session-secret"] = string(securecookie.GenerateRandomKey(64)) s.SessionSecret = session.Values["session-secret"].(string)