Get rid of email and names
diff --git a/core/kg/model/user.go b/core/kg/model/user.go
index b7cdb65..6feb948 100644
--- a/core/kg/model/user.go
+++ b/core/kg/model/user.go
@@ -1,9 +1,7 @@
package model
import (
- "net/mail"
"regexp"
- "strings"
"unicode"
"github.com/pkg/errors"
@@ -23,10 +21,6 @@
DeleteAt int64 `json:"delete_at"`
Username string `json:"username"`
Password string `json:"password,omitempty"`
- Email string `json:"email"`
- EmailVerified bool `json:"email_verified,omitempty"`
- FirstName string `json:"first_name"`
- LastName string `json:"last_name"`
LastPasswordUpdate int64 `json:"last_password_update,omitempty"`
}
@@ -49,10 +43,6 @@
return invalidUserError("username", u.ID)
}
- if !isValidEmail(u.Email) {
- return invalidUserError("email", u.ID)
- }
-
return nil
}
@@ -86,25 +76,3 @@
return true
}
-
-func isValidEmail(email string) bool {
- if len(email) > userEmailMaxLength || email == "" {
- return false
- }
- if !isLower(email) {
- return false
- }
-
- if addr, err := mail.ParseAddress(email); err != nil {
- return false
- } else if addr.Name != "" {
- // mail.ParseAddress accepts input of the form "Billy Bob <billy@example.com>" which we don't allow
- return false
- }
-
- return true
-}
-
-func isLower(s string) bool {
- return strings.ToLower(s) == s
-}
diff --git a/core/kg/store/sqlstore/user_store.go b/core/kg/store/sqlstore/user_store.go
index 992d22b..78a8e69 100644
--- a/core/kg/store/sqlstore/user_store.go
+++ b/core/kg/store/sqlstore/user_store.go
@@ -30,10 +30,6 @@
delete_at INTEGER,
username VARCHAR(64) UNIQUE,
password VARCHAR(128) NULL,
- email VARCHAR(128) UNIQUE,
- email_verified BOOL NOT NULL DEFAULT FALSE,
- first_name VARCHAR(64),
- last_name VARCHAR(64),
last_password_update INTEGER);`
us.db.MustExec(schema)