clean up authentication and flash messages