create object literal for view, add authSuccess and authFail functions