Skip to content

Conversation

nickpatrick
Copy link
Contributor

No description provided.

},
});

let sclVal = -1;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove old ping call

let lastIp: string | null = null;

class VerifyAPI {
static async ipChanged() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls GET /v1/ping, returns true if IP changed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would call this function checkIPChange

Also, should this function only fire if lastIp is set? otherwise it will always trigger a change

let { interval } = params;
if (!interval) {
interval = 60;
Logger.info(`interval not provided, using 60 seconds`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds default interval of 60 seconds, avoids bug if interval undefined

ipChanged = await this.ipChanged();
}

if (lastToken && lastToken.passed && !ipChanged) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requests new token if IP changed

{ style },
);
Logger.debug('map initailized with options', mapOptions);
Logger.debug('map initialized with options', mapOptions);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo

}
}

if (params.ipChanges && trackRes?.user?.ip) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also picks up IP changes in trackVerified() responses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants