Added type to register, copy and pasted some code to make a quick and dirty login.