sql: added code migration type

This commit is contained in:
Torkel Ödegaard
2018-08-21 13:53:04 +02:00
parent 6316d637f1
commit 92ed1f04af
6 changed files with 90 additions and 9 deletions
+3 -2
View File
@@ -113,9 +113,10 @@ func CreateUser(ctx context.Context, 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)
}