Created
August 10, 2010 04:38
-
-
Save jtwb/516678 to your computer and use it in GitHub Desktop.
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
handle: function(request, response) { | |
var self = this, | |
context = new requestcontext.RequestContext({request:request}), | |
isNewPlayerCommand, | |
implResponse; | |
isNewPlayerCommand = self.impl.isNewPlayerCommand(context); | |
if (!isNewPlayerCommand) { | |
if (!self.authenticator.isValid(context)) { | |
log.message('... Ignored, authenticator disabled', 'error'); | |
// TODO disabled for now | |
// self.accessDenied(context, response); | |
// return; | |
} | |
} | |
// if we're good, commit change to world | |
implResponse = self.impl.handle(context); | |
if (isNewPlayerCommand) { | |
var credentials = self.authenticator.createUser(context); | |
implResponse = core.extend(implResponse, credentials); | |
} | |
self.ok(implResponse); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment