Add validation and logout support