mirror of
https://github.com/grafana/grafana.git
synced 2026-08-19 01:34:54 -05:00
Worked on login remember cookie, and redirect after login
This commit is contained in:
@@ -50,6 +50,9 @@ func addUserMigrations(mg *Migrator) {
|
||||
Table("user").Columns("login").Unique())
|
||||
mg.AddMigration("add unique index user.email", new(AddIndexMigration).
|
||||
Table("user").Columns("email").Unique())
|
||||
|
||||
mg.AddMigration("add column user.rands", new(AddColumnMigration).
|
||||
Table("user").Column(&Column{Name: "rands", Type: DB_NVarchar, Length: 255, Nullable: true}))
|
||||
}
|
||||
|
||||
func addAccountMigrations(mg *Migrator) {
|
||||
|
||||
@@ -41,6 +41,7 @@ func EnsureAdminUser() {
|
||||
cmd.Login = setting.AdminUser
|
||||
cmd.Email = setting.AdminUser + "@localhost"
|
||||
cmd.Salt = util.GetRandomString(10)
|
||||
cmd.Rands = util.GetRandomString(10)
|
||||
cmd.Password = util.EncodePassword(setting.AdminPassword, cmd.Salt)
|
||||
cmd.IsAdmin = true
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ func CreateUser(cmd *m.CreateUserCommand) error {
|
||||
Login: cmd.Login,
|
||||
Company: cmd.Company,
|
||||
Salt: cmd.Salt,
|
||||
Rands: cmd.Rands,
|
||||
IsAdmin: cmd.IsAdmin,
|
||||
AccountId: account.Id,
|
||||
Created: time.Now(),
|
||||
|
||||
Reference in New Issue
Block a user