Updated user authentication code and views.