mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 16:40:21 +00:00
generate agent_secret for old users (#1021)
This commit is contained in:
1 parent
f110ff761a
commit
d0f69c424e
4 files changed
+31
-8
No files matched your search
+3
-1
@@ -13,6 +13,8 @@ const (
|
||||
RoleMember
|
||||
)
|
||||
|
||||
const DefaultAgentSecretLength = 32
|
||||
|
||||
type User struct {
|
||||
Common
|
||||
Username string `json:"username,omitempty" gorm:"uniqueIndex"`
|
||||
@@ -32,7 +34,7 @@ func (u *User) BeforeSave(tx *gorm.DB) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
key, err := utils.GenerateRandomString(32)
|
||||
key, err := utils.GenerateRandomString(DefaultAgentSecretLength)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user