Update usercontroller.js

add check of user authentication