Authentication module working code