Add authentication logic