CE-2516: Fix login form
The useEffect which sets the user and userRoles was not updating the second time since when doing the refetch the same data is returned, so the useEffect doesn't trigger. The only workarounds I found was to either set an arbitrary trigger state which would make the useEffect trigger, or how I've done it now. I also added a manual loading state since we need to wait for the user and userRoles responses before we set them in order to update the correct user.
I also decided to refactor the LoginForm component in common since it was getting the form data in a quite un-react way and felt like it could use a cleanup.
Edited by Max Frederiksen