Skip to content

Commit

Permalink
Addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluisdiaz committed Mar 1, 2017
1 parent 6d9cdb5 commit 40821ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,13 @@ auth0GuardianJS.start(function(err, transaction) {
});
```
### auth0GuardianJS.resume(options, transactionState, callback)
This continues a transaction saved by `transaction.serialize()`. The option parameter provides
the final user the opportunity to specify which kind of `transport` to use. That been:
This continues a transaction saved by `transaction.serialize()`. The options parameter provides
the library user the opportunity to specify which kind of `transport` to use. Options include:

- `socket`: a socket.io transport
- `pooling`: a pooling transport.
- `polling`: a polling transport.

The default one is `socket`.
If not set, the `socket` transport is used as default

This is a factory method, you SHOULD NOT instantiate`auth0GuardianJS`.

Expand All @@ -316,7 +316,7 @@ Later, in another part of the code:
```js
var serializedTransaction = secureStorage.get('guardiantx');

auth0GuardianJS.resume({ transport: 'pooling' }, serializedTransaction, function(err, transaction) {
auth0GuardianJS.resume({ transport: 'polling' }, serializedTransaction, function(err, transaction) {
//... continue using that transaction object.
});

Expand Down Expand Up @@ -419,8 +419,8 @@ transaction.recover({ recoveryCode: recoveryCode });
```

#### transaction.serialize()
The .serialize() method creates a plain javascript Object that should remind opaque
to the final user. This must be stored by the user in a secure way.
The .serialize() method creates a plain javascript Object that should remain opaque
to the library user. This must be stored by the user in a secure way.

This object is used in combination with `auth0GuardianJS.resume`

Expand Down
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ auth0GuardianJS.prototype.start = function start(callback) {
/**
* @public
*
* This takes a parameter what transaction.serialize returns to
* resume the transaction with auth0-mfa-api
* Takes a parameter returned from transaction.serialize to resume the transaction
* with auth0-mfa-api
*
* @param {string} transactionState.transactionToken
*
Expand Down Expand Up @@ -186,7 +186,7 @@ auth0GuardianJS.resume = function resume(options, transactionState, callback) {
/**
* @public
*
* Post result to url using an standard form
* Post result to url using a standard form
*
* @param {string} url url to post
* @param {object} obj result with signature to post
Expand Down
3 changes: 2 additions & 1 deletion lib/transaction/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ exports.fromStartFlow = function buildTransactionFromStartFlow(data, options) {
* @param {object} transactionState.availableAuthenticationMethods
*
* @param {EventEmitter} options.transactionEventsReceiver
* Receiver for transaction events; it will receive backend related transaction events
* Receiver for transaction events; it will receive backend related transaction events
*
* @param {HttpClient} options.HttpClient
*
* @returns {Transaction}
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/client_factory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var pooling = require('./polling_client');
var polling = require('./polling_client');
var socketio = require('./socket_client');

exports.create = function create(options) {
Expand All @@ -12,7 +12,7 @@ exports.create = function create(options) {
}

if (transport === 'polling') {
return pooling(serviceUrl, { httpClient: httpClient });
return polling(serviceUrl, { httpClient: httpClient });
}

// default socket
Expand Down

0 comments on commit 40821ba

Please sign in to comment.