Moved authentication logic from fragments to activity. Working on #29.