mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 10:55:30 -04:00
Allow hyphens in username (#99)
This commit is contained in:
parent
220fc42bf2
commit
a68f3eea95
@ -2,9 +2,9 @@ def validate_username(username)
|
||||
if username.size < 3
|
||||
raise "Username should contain at least 3 characters"
|
||||
end
|
||||
if (username =~ /^[A-Za-z0-9_]+$/).nil?
|
||||
raise "Username should contain alphanumeric characters " \
|
||||
"and underscores only"
|
||||
if (username =~ /^[a-zA-Z_][a-zA-Z0-9_\-]*$/).nil?
|
||||
raise "Username can only contain alphanumeric characters, " \
|
||||
"underscores, and hyphens"
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user