Updated login/token confirmation code