Skip to content

Instantly share code, notes, and snippets.

@rahatarmanahmed
Forked from zackurben/gist:51ee9b92c26ad8a7c290
Last active September 18, 2015 15:23
Show Gist options
  • Save rahatarmanahmed/a04cf6166ba8347ff629 to your computer and use it in GitHub Desktop.
Save rahatarmanahmed/a04cf6166ba8347ff629 to your computer and use it in GitHub Desktop.
User Authentication Example
var request = require('request');
request.post(
'https://{projectname}.form.io/{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