Login works

Fixed login bugs so now user can be logged in or registered