Skip to content
Snippets Groups Projects
Commit 5c7f9d55 authored by Rick Carback's avatar Rick Carback
Browse files

Set the user e-mail appropriately

parent b9d48e00
No related branches found
No related tags found
No related merge requests found
...@@ -237,10 +237,6 @@ func (cl *Client) Register(preCan bool, registrationCode, nick, email string) (* ...@@ -237,10 +237,6 @@ func (cl *Client) Register(preCan bool, registrationCode, nick, email string) (*
u.Nick = nick u.Nick = nick
} }
if email != "" {
u.Email = email
}
nodekeys, successKeys := user.Users.LookupKeys(u.User) nodekeys, successKeys := user.Users.LookupKeys(u.User)
if !successKeys { if !successKeys {
...@@ -403,6 +399,8 @@ func (cl *Client) Register(preCan bool, registrationCode, nick, email string) (* ...@@ -403,6 +399,8 @@ func (cl *Client) Register(preCan bool, registrationCode, nick, email string) (*
user.Users.UpsertUser(u) user.Users.UpsertUser(u)
} }
u.Email = email
// Create the user session // Create the user session
nus := user.NewSession(cl.storage, u, nk, publicKey, privateKey, cmixGrp, e2eGrp) nus := user.NewSession(cl.storage, u, nk, publicKey, privateKey, cmixGrp, e2eGrp)
......
...@@ -186,7 +186,7 @@ func sessionInitialization() (*id.User, *api.Client) { ...@@ -186,7 +186,7 @@ func sessionInitialization() (*id.User, *api.Client) {
// doesn't support non pre canned users // doesn't support non pre canned users
uid = id.NewUserFromUints(&[4]uint64{0, 0, 0, userId}) uid = id.NewUserFromUints(&[4]uint64{0, 0, 0, userId})
// clear userEmail if it was defined, since login was previously done // clear userEmail if it was defined, since login was previously done
userEmail = "" //userEmail = ""
globals.Log.INFO.Printf("Skipped Registration, user: %v", uid) globals.Log.INFO.Printf("Skipped Registration, user: %v", uid)
} }
......
...@@ -237,6 +237,7 @@ func (s *SessionObj) GetCurrentUser() (currentUser *User) { ...@@ -237,6 +237,7 @@ func (s *SessionObj) GetCurrentUser() (currentUser *User) {
currentUser = &User{ currentUser = &User{
User: s.CurrentUser.User, User: s.CurrentUser.User,
Nick: s.CurrentUser.Nick, Nick: s.CurrentUser.Nick,
Email: s.CurrentUser.Email,
} }
} }
return currentUser return currentUser
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment