[+] Verify username and password for register

This commit is contained in:
Hykilpikonna
2021-01-22 15:07:09 -05:00
parent 788eb4973a
commit a375f16947
+10
View File
@@ -25,6 +25,16 @@ class LoginVC: UIViewController
@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")
}
}