Adds basic error handling for popup login
Improves error handling on login and registration