refactor; make BE call when login