refactor api login method to use a callback and use the nav in the login to go to the userPage