Update authentication logic