iF AND else for authentication