add check_auth function to check if credentials are ok