Skip to content

Instantly share code, notes, and snippets.

@rodionbykov
Last active August 29, 2015 14:27
Show Gist options
  • Save rodionbykov/081d49c595760e9c0461 to your computer and use it in GitHub Desktop.
Save rodionbykov/081d49c595760e9c0461 to your computer and use it in GitHub Desktop.
FW/1 REST API controller
component accessors="true" {
property name="SecurityService";
function init(fw){
variables.fw = fw;
}
function login(rc){
var jsondata = DeserializeJSON(GetHttpRequestData().content);
var user = VARIABLES.SecurityService.login(jsondata.login, jsondata.password);
variables.fw.renderData("json", user);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment