Created
January 25, 2014 08:01
-
-
Save adoc/8613268 to your computer and use it in GitHub Desktop.
temp: tightenauth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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