add test code for sign out
refactor controllers add the before_filter