RM: login functionality and view.