diff --git a/api/client.go b/api/client.go index 307f6e59877e73b18d1a464d71a2092874b2040d..a132470c3ce24645daace7a6bf2a2cb4e3093db1 100644 --- a/api/client.go +++ b/api/client.go @@ -237,10 +237,6 @@ func (cl *Client) Register(preCan bool, registrationCode, nick, email string) (* u.Nick = nick } - if email != "" { - u.Email = email - } - nodekeys, successKeys := user.Users.LookupKeys(u.User) if !successKeys { @@ -403,6 +399,8 @@ func (cl *Client) Register(preCan bool, registrationCode, nick, email string) (* user.Users.UpsertUser(u) } + u.Email = email + // Create the user session nus := user.NewSession(cl.storage, u, nk, publicKey, privateKey, cmixGrp, e2eGrp) diff --git a/cmd/root.go b/cmd/root.go index 4ef53cb481aa55855a6bb2d453f90f6f01adcc63..001bf648cb485de335b082fff4724961d485977c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -186,7 +186,7 @@ func sessionInitialization() (*id.User, *api.Client) { // doesn't support non pre canned users uid = id.NewUserFromUints(&[4]uint64{0, 0, 0, userId}) // clear userEmail if it was defined, since login was previously done - userEmail = "" + //userEmail = "" globals.Log.INFO.Printf("Skipped Registration, user: %v", uid) } diff --git a/user/session.go b/user/session.go index 33affb1523c01482278c5205f3c932b1fe889084..43c8144e14f74d23c6343bb0aba34551858b6196 100644 --- a/user/session.go +++ b/user/session.go @@ -235,8 +235,9 @@ func (s *SessionObj) GetCurrentUser() (currentUser *User) { if s.CurrentUser != nil { // Explicit deep copy currentUser = &User{ - User: s.CurrentUser.User, - Nick: s.CurrentUser.Nick, + User: s.CurrentUser.User, + Nick: s.CurrentUser.Nick, + Email: s.CurrentUser.Email, } } return currentUser