Skip to content

Instantly share code, notes, and snippets.

@adoc
Created January 25, 2014 08:01
Show Gist options
  • Save adoc/8613268 to your computer and use it in GitHub Desktop.
Save adoc/8613268 to your computer and use it in GitHub Desktop.
temp: tightenauth
// Update the time provider and ip address.
// Called on every page, cause.
var tightenAuth22 = function() {
apiCall('/ping', {}, function(data) {
authApi.timeProvider.reset(data._time);
authApi.clientIp = data._addr;
authApi.tight = true;
if (opts.success) {
opts.success();
}
if (data.clientId) {
if (opts.logged_in) {
opts.logged_in();
}
}
else {
if (opts.logged_out) {
opts.logged_out();
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment