Added onetime auth code and tests