added functionality for logging out and checking if logged in when using @withAuth