Skip to content

Instantly share code, notes, and snippets.

@randallknutson
Created July 17, 2015 15:03
Show Gist options
  • Save randallknutson/bbe8dd3099234a73c716 to your computer and use it in GitHub Desktop.
Save randallknutson/bbe8dd3099234a73c716 to your computer and use it in GitHub Desktop.
User Authentication Example
var request = require('request');
request.post(
'https://{appname}.form.io/app/api/{userresource}/{loginform}/submission',
{
data: {
'{userresource}.{emailfield}': email,
'{userresource}.{passwordfield}': password
}
},
function (error, response, body) {
if (!error && response.statusCode == 200) {
token = res.headers['x-jwt-token'];
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment