refactor: login and auth