Add some logic for authentication with token.