Add willLog() and control access to signup page.

This commit is contained in:
Yang Luo
2021-05-08 00:23:08 +08:00
parent 75f23478d1
commit e3b3a76088
7 changed files with 73 additions and 35 deletions

View File

@ -86,15 +86,6 @@ func GetUser(id string) *User {
return getUser(owner, name)
}
func HasUser(id string) bool {
return GetUser(id) != nil
}
func IsPasswordCorrect(userId string, password string) bool {
user := GetUser(userId)
return user.Password == password
}
func UpdateUser(id string, user *User) bool {
owner, name := util.GetOwnerAndNameFromId(id)
if getUser(owner, name) == nil {
@ -224,10 +215,6 @@ func GetUserField(user *User, field string) string {
func GetMaskedUser(user *User) *User {
user.Password = "***"
user.Github = "***"
user.Google = "***"
user.QQ = "***"
user.WeChat = "***"
return user
}