/**
* GPII get token Handler
*
* Copyright 2014 Raising the Floor - International
*
* Licensed under the New BSD license. You may not use this file except in
* compliance with this License.
*
* The research leading to these results has received funding from the European Union's
* Seventh Framework Programme (FP7/2007-2013)
* under grant agreement no. 289016.
*
* You may obtain a copy of the License at
* https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
var fluid = require("infusion");
var gpii = fluid.registerNamespace("gpii");
fluid.defaults("gpii.flowManager.getUserToken.handler", {
gradeNames: ["kettle.request.http", "gpii.flowManager.sessionAware"],
invokers: {
handleRequest: {
funcName: "gpii.flowManager.getUserToken.handleRequest",
args: ["{that}", "{request}.events"
]
}
}
});
gpii.flowManager.getUserToken.handleRequest = function (that, events) {
that.withSession(function (session, userTokens) {
fluid.log("Reporting currently logged in user token(s) as: ", userTokens);
events.onSuccess.fire(userTokens);
}, "No user currently logged in to the system");
};
|