Redirect to login for duplicate emails (fixes #19)
Rename test command
Use codes to identify ticket types