mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 13:40:06 +00:00
🔒️ more secure token generation
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/google/go-github/v47/github"
|
||||
"github.com/xanzy/go-gitlab"
|
||||
|
||||
"github.com/naiba/nezha/pkg/utils"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
@@ -72,8 +69,3 @@ func NewUserFromGitHub(gu *github.User) User {
|
||||
u.Bio = gu.GetBio()
|
||||
return u
|
||||
}
|
||||
|
||||
func (u *User) IssueNewToken() {
|
||||
u.Token = utils.MD5(fmt.Sprintf("%d%d%s", time.Now().UnixNano(), u.ID, u.Login))
|
||||
u.TokenExpired = time.Now().AddDate(0, 2, 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user