implemented token-based authentication