[+] Verify username and password for register
This commit is contained in:
@@ -25,6 +25,16 @@ class LoginVC: UIViewController
|
|||||||
|
|
||||||
@IBAction func register(_ sender: Any)
|
@IBAction func register(_ sender: Any)
|
||||||
{
|
{
|
||||||
|
// Verify username and password
|
||||||
|
guard username.text ~= "[A-Za-z0-9_-]{3,16}" else
|
||||||
|
{
|
||||||
|
alert("Username Invalid", "Username must be 3 to 16 characters long, and must only contain a-z, 0-9, underscore, and minus signs (-).")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
guard password.text?.count? > 8 else
|
||||||
|
{
|
||||||
|
alert("Password Invalid", "Password must be more than 8 characters long")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user