@_cacheAuthUser
def getCurrentUser(returnToken=False):
    event = events.trigger('auth.user.get')
    if event.defaultPrevented and len(event.responses) > 0:
        return event.responses[0]

    token = getCurrentToken()

    def retVal(user, token):
        if returnToken:
            return user, token
        else:
            return user

    if (token is None or token['expires'] < datetime.datetime.utcnow() or
            'userId' not in token):
        return retVal(None, token)
    else:
        try:
            ensureTokenScopes(token, getattr(
                cherrypy.request, 'requiredScopes', TokenScope.USER_AUTH))
        except AccessException:
            return retVal(None, token)

        user = ModelImporter.model('user').load(token['userId'], force=True)
        return retVal(user, token)
This is a shortcut instad of calling msg() directly on an
dataset/ETHPy150Open girder/girder/girder/api/rest.py/getCurrentUser--crossover with--dataset/ETHPy150Open evennia/evennia/evennia/commands/command.py/Command.msg