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")
|
c.Perf.StartBlock("SQL", "Check blacklist")
|
||||||
// TODO(asaf): Check email against blacklist
|
if emailIsBlacklisted(emailAddress) {
|
||||||
blacklisted := false
|
|
||||||
if blacklisted {
|
|
||||||
// NOTE(asaf): Silent rejection so we don't allow attackers to harvest emails.
|
// NOTE(asaf): Silent rejection so we don't allow attackers to harvest emails.
|
||||||
return c.Redirect(hmnurl.BuildRegistrationSuccess(), http.StatusSeeOther)
|
return c.Redirect(hmnurl.BuildRegistrationSuccess(), http.StatusSeeOther)
|
||||||
}
|
}
|
||||||
|
@ -882,3 +880,13 @@ func validateUsernameAndToken(c *RequestContext, username string, token string,
|
||||||
func urlIsLocal(url string) bool {
|
func urlIsLocal(url string) bool {
|
||||||
return strings.HasPrefix(url, config.Config.BaseUrl)
|
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