From 52faded952ec4dfc5b07e785599f72a3a0aec7d6 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sat, 8 Feb 2014 14:07:02 -0700 Subject: [PATCH] fixed issue #15 --- pkg/handler/app.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/handler/app.go b/pkg/handler/app.go index 86cd1121..73df372b 100644 --- a/pkg/handler/app.go +++ b/pkg/handler/app.go @@ -138,9 +138,6 @@ func ResetPost(w http.ResponseWriter, r *http.Request) error { } // add the user to the session object - //session, _ := store.Get(r, "_sess") - //session.Values["username"] = user.Email - //session.Save(r, w) SetCookie(w, r, "_sess", user.Email) http.Redirect(w, r, "/dashboard", http.StatusSeeOther) @@ -156,9 +153,7 @@ func RegisterPost(w http.ResponseWriter, r *http.Request) error { } // set the email and name - user := User{} - user.SetEmail(email) - user.Name = r.FormValue("name") + user := NewUser(r.FormValue("name"), email) // set the new password password := r.FormValue("password") @@ -172,7 +167,7 @@ func RegisterPost(w http.ResponseWriter, r *http.Request) error { } // save to the database - if err := database.SaveUser(&user); err != nil { + if err := database.SaveUser(user); err != nil { return err }