moved all login logic out of main fragment into login fragment