You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by sa...@apache.org on 2016/11/25 16:06:26 UTC

[1/2] incubator-milagro-mfa-js-lib git commit: Add initial initialisation of the local storage This prevent some problems when trying to access it and the info is not avaible

Repository: incubator-milagro-mfa-js-lib
Updated Branches:
  refs/heads/master a0889dbc5 -> 2223f7cd1


Add initial initialisation of the local storage
This prevent some problems when trying to access it and the info is not
avaible


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-js-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-js-lib/commit/06e0c9eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-js-lib/tree/06e0c9eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-js-lib/diff/06e0c9eb

Branch: refs/heads/master
Commit: 06e0c9eb61b8f4a4298aa99821befe68e12dadba
Parents: 0631cff
Author: Pavlin Angelov <pa...@miracl.com>
Authored: Mon Nov 7 10:38:05 2016 +0200
Committer: Pavlin Angelov <pa...@miracl.com>
Committed: Mon Nov 7 17:37:04 2016 +0200

----------------------------------------------------------------------
 lib/mpin.js | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-js-lib/blob/06e0c9eb/lib/mpin.js
----------------------------------------------------------------------
diff --git a/lib/mpin.js b/lib/mpin.js
index 12901c3..c3d7e89 100644
--- a/lib/mpin.js
+++ b/lib/mpin.js
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -65,6 +65,16 @@ var mpinjs = (function () {
     var self = this, _initUrl;
 
     this.recover();
+
+    var mpinData = this.getData();
+    if (!mpinData) {
+      mpinData = {
+        version: "4",
+        accounts: {}
+      };
+      this.storeData(mpinData);
+    }
+
     if (this.opts.server.slice(-1) === "/") {
       _initUrl = this.opts.server;
     } else {
@@ -889,15 +899,7 @@ var mpinjs = (function () {
   Mpin.prototype.setData = function (userId, upData) {
     var mpinData = this.getData();
 
-    if (!mpinData) {
-      mpinData = {
-        version: "4",
-        accounts: {}
-      };
-    }
-
     var mpinId = upData.mpinId || Users[userId].mpinId;
-
     if (!mpinId) {
       return false;
     }


[2/2] incubator-milagro-mfa-js-lib git commit: Merge remote-tracking branch 'github-miracl/master'

Posted by sa...@apache.org.
Merge remote-tracking branch 'github-miracl/master'


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-js-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-js-lib/commit/2223f7cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-js-lib/tree/2223f7cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-js-lib/diff/2223f7cd

Branch: refs/heads/master
Commit: 2223f7cd1c60b1e8192be09ff9e53877dc1cf251
Parents: a0889db 06e0c9e
Author: Simeon Aladjem <si...@miracl.com>
Authored: Fri Nov 25 18:06:13 2016 +0200
Committer: Simeon Aladjem <si...@miracl.com>
Committed: Fri Nov 25 18:06:13 2016 +0200

----------------------------------------------------------------------
 lib/mpin.js | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------