Update log out feature to use token middleware