sql: added code migration type

(cherry picked from commit 92ed1f04af)
This commit is contained in:
Torkel Ödegaard
2018-08-21 13:56:08 +02:00
parent aeaf7b23a6
commit df83bf10a2
6 changed files with 90 additions and 9 deletions
+3 -2
View File
@@ -104,9 +104,10 @@ func CreateUser(cmd *m.CreateUserCommand) error {
LastSeenAt: time.Now().AddDate(-10, 0, 0),
}
user.Salt = util.GetRandomString(10)
user.Rands = util.GetRandomString(10)
if len(cmd.Password) > 0 {
user.Salt = util.GetRandomString(10)
user.Rands = util.GetRandomString(10)
user.Password = util.EncodePassword(cmd.Password, user.Salt)
}