fixed login and added max length to user input

login wasn't waiting for the background tasks to complete when
registering for the first time.