diff --git a/app/assets/javascripts/app/directives/views/accountMenu.js b/app/assets/javascripts/app/directives/views/accountMenu.js index 577213257..063b133a9 100644 --- a/app/assets/javascripts/app/directives/views/accountMenu.js +++ b/app/assets/javascripts/app/directives/views/accountMenu.js @@ -13,7 +13,7 @@ class AccountMenu { $timeout, storageManager, $compile, archiveManager) { 'ngInject'; - $scope.formData = {mergeLocal: true, url: syncManager.serverURL, ephemeral: false, email: "a@bitar.io", user_password: "password"}; + $scope.formData = {mergeLocal: true, url: syncManager.serverURL, ephemeral: false}; $scope.user = authManager.user; $scope.server = syncManager.serverURL; @@ -80,8 +80,8 @@ class AccountMenu { $timeout(() => { $scope.formData.showLogin = true; $scope.formData.mfa = null; + if(error.message) { alert(error.message); } }) - alert(error.message); } } diff --git a/app/assets/javascripts/app/services/authManager.js b/app/assets/javascripts/app/services/authManager.js index 6b4d0311d..0061b55e4 100644 --- a/app/assets/javascripts/app/services/authManager.js +++ b/app/assets/javascripts/app/services/authManager.js @@ -77,7 +77,8 @@ angular.module('app') var keys = this.keys(); if(keys && keys.ak) { - return "003"; + // If there's no version stored, and there's an ak, it has to be 002. Newer versions would have thier version stored in authParams. + return "002"; } else { return "001"; } @@ -132,6 +133,7 @@ angular.module('app') if(SFJS.isProtocolVersionOutdated(authParams.version)) { let message = `The encryption version for your account, ${authParams.version}, is outdated and requires upgrade. You may proceed with login, but are advised to follow prompts for Security Updates once inside. Please visit standardnotes.org/help/security for more information.\n\nClick 'OK' to proceed with login.` if(!confirm(message)) { + callback({error: {}}); return; } }