Improve error reporting in demo mode
This commit is contained in:
@@ -28,6 +28,7 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
|
||||
$scope.twoFactorAuthentication = {
|
||||
busy: false,
|
||||
error: null,
|
||||
notSupportedError: null,
|
||||
password: '',
|
||||
totpToken: '',
|
||||
secret: '',
|
||||
@@ -38,6 +39,7 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
|
||||
reset: function () {
|
||||
$scope.twoFactorAuthentication.busy = false;
|
||||
$scope.twoFactorAuthentication.error = null;
|
||||
$scope.twoFactorAuthentication.notSupportedError = null;
|
||||
$scope.twoFactorAuthentication.password = '';
|
||||
$scope.twoFactorAuthentication.totpToken = '';
|
||||
$scope.twoFactorAuthentication.secret = '';
|
||||
@@ -54,7 +56,8 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
|
||||
$scope.twoFactorAuthentication.mandatory2FAHelp = false;
|
||||
|
||||
Client.setTwoFactorAuthenticationSecret(function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
if (error && error.statusCode === 400) return $scope.twoFactorAuthentication.notSupportedError = error.message;
|
||||
else if (error) return console.error(error);
|
||||
|
||||
$scope.twoFactorAuthentication.secret = result.secret;
|
||||
$scope.twoFactorAuthentication.qrcode = result.qrcode;
|
||||
|
||||
Reference in New Issue
Block a user