Source code

https://github.com/circlesystems/Auth0



This is an express app.


app.get(‘/circle-token’, async function (req, res) {

    const token = await circleToken();

    res.send(token);


});





Headers


X-circle-appkey

Authorization: Bearer eyJhbGciOiJIUz..8nb0




Check if Circle Service is Running


 circle.isServiceRunning = async function () {


    if (_isMobileScreen) {

      _createFullScreenDiv();

      return false;

    }


    if (_isCircleWV) {

      return apiInstance.isServiceRunning();

    } else {

      if (_isServiceRunning) {

        return _isServiceRunning;

      }


      return fetch(_serverUrl, {

        method: “GET”,

        headers: {

          “x-circle-appkey”: _options.appKey,

        },

      }).then(async res => {

        console.log(“Circle is Running!”);

        _isServiceRunning = true;

        return _isServiceRunning;

      }).catch(err => {

        console.error(“Circle is offline!”);

        _isServiceRunning = false;

        return _isServiceRunning;

      });

    }

  };




Authorize

http://127.0.0.1:31415/v1/authorize




{

  “Result”: true,

  “ErrorCode”: 0,

  “Message”: “”

}


Token: eyJhbGciOiJIUz…ditUx1FpJs8nb0

 


Check if User is Locked


async function checkUserIsLocked() {


  await checkCircleService();


  const circleTopicData = await getCircleAndTopic();


  if (!circleTopicData) {

    return null;

  }


  const userData = await Circle.whoAmI(circleTopicData.CircleId);


  if (!userData || !userData.Locked) {

    return null;

  }


  $(“#enterCodesModal”).modal(‘show’);

}





Enumerate Circles




Logout