Implemented authorization and logout