Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed jetpack specific stuff from client.js

  • Loading branch information...
commit fe2b272b0bf883a559caac086fac64fb074c0321 1 parent cf34199
@ckarlof ckarlof authored
Showing with 6 additions and 13 deletions.
  1. +6 −13 client/client.js
View
19 client/client.js
@@ -18,19 +18,12 @@ GombotClient = function(path, options) {
this.user = options.user;
this.keys = options.keys;
-};
-function derive(args, cb) {
- if (typeof require !== "undefined") {
- var kdf = require("gombot-crypto-jetpack");
- kdf.kdf(args.email, args.password).then(function(keys) {
- cb(null, keys);d
- });
- }
- else {
+ // allow instantiators to supply own implementation of KDF function
+ this.derive = options.kdfDerive || function(args, cb) {
GombotCrypto.derive(args, cb);
- }
-}
+ };
+};
var xhr = typeof jQuery !== 'undefined' ? jQuery.ajax : require('xhrequest');
@@ -145,7 +138,7 @@ GombotClient.prototype = {
args.path = this.path + '/v1/account';
// compute the authKey
- var headers = derive({
+ var headers = this.derive({
email: args.email,
password: args.pass
}, function(err, r) {
@@ -172,7 +165,7 @@ GombotClient.prototype = {
signIn: function(args, cb) {
var self = this;
// compute the authKey
- derive({
+ this.derive({
email: args.email,
password: args.pass
}, function(err, r) {
Please sign in to comment.
Something went wrong with that request. Please try again.