mirror of
https://github.com/nezhahq/nezha.git
synced 2025-02-02 01:28:13 -05:00
fix for backward compatibility
This commit is contained in:
parent
915a20007e
commit
1824fb86cd
@ -21,6 +21,13 @@ func initUser() {
|
||||
var users []model.User
|
||||
DB.Find(&users)
|
||||
|
||||
// for backward compatibility
|
||||
UserInfoMap[0] = model.UserInfo{
|
||||
Role: model.RoleAdmin,
|
||||
AgentSecret: Conf.AgentSecretKey,
|
||||
}
|
||||
AgentSecretToUserId[Conf.AgentSecretKey] = 0
|
||||
|
||||
for _, u := range users {
|
||||
UserInfoMap[u.ID] = model.UserInfo{
|
||||
Role: u.Role,
|
||||
|
Loading…
Reference in New Issue
Block a user