add authentication code from previous project