register return error instead of bool

This commit is contained in:
Your Name
2024-03-01 09:37:41 -06:00
parent 972110aded
commit 0cb02fb65f
3 changed files with 10 additions and 10 deletions

View File

@@ -40,8 +40,8 @@ func main() {
scsusers.Init(db, "test", "Example Test", "nobody@nowhere.com", "localhost:25", true)
a:=scsusers.UsernameAvailable("testuser")
fmt.Printf("Initial test of username available: %v\n", a)
a=scsusers.Register("testuser", email, "127.0.0.1")
fmt.Printf("Register returned %v\n",a)
err=scsusers.Register("testuser", email, "127.0.0.1")
fmt.Printf("Register returned %v\n",err)
fmt.Printf("Attempt to log in with invalid username returned %v\n", scsusers.Login("baduser", "badpass"))
fmt.Printf("Enter code from email:")
var code string