miscellaneous characters from my keyboard
This commit is contained in:
parent
ad62793262
commit
74f438afad
|
@ -202,9 +202,7 @@ func RegisterNewUserSubmit(c *RequestContext) ResponseData {
|
|||
}
|
||||
|
||||
c.Perf.StartBlock("SQL", "Check blacklist")
|
||||
// TODO(asaf): Check email against blacklist
|
||||
blacklisted := false
|
||||
if blacklisted {
|
||||
if emailIsBlacklisted(emailAddress) {
|
||||
// NOTE(asaf): Silent rejection so we don't allow attackers to harvest emails.
|
||||
return c.Redirect(hmnurl.BuildRegistrationSuccess(), http.StatusSeeOther)
|
||||
}
|
||||
|
@ -882,3 +880,13 @@ func validateUsernameAndToken(c *RequestContext, username string, token string,
|
|||
func urlIsLocal(url string) bool {
|
||||
return strings.HasPrefix(url, config.Config.BaseUrl)
|
||||
}
|
||||
|
||||
func emailIsBlacklisted(email string) bool {
|
||||
if strings.Count(email, ".") > 5 {
|
||||
return true
|
||||
}
|
||||
|
||||
// TODO(asaf): Actually check email against blacklist
|
||||
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue