consulate-authcode-simple-secrets
simple-secrets authcode plugin for consulate
Usage
Just register consulate-authcode-simple-secrets
as a plugin with your consulate server:
var consulate = authcode = ; var app = ; // Give a few db methodsvar db = // Save a simple flag to the db that the code hasn't been used { // do db work here ; } // Validate the code exists and has not been used { // do db work here ; } // Invalidate a code so it cannot be used again { // do db work here ; }; app;
NOTE
It is also recommended that an expiration of about 10 minutes be set on valid authorization codes
Tests
$ npm test