added user authorization and flash messages to views
added user authorization and flash messages to views