summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-12-21 07:24:33 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2016-12-21 07:24:33 +0000
commit528c3e2b8d2d65257e489601220f34b918b80e17 (patch)
tree0b7b64f2542d166c19b12415621087d5635c2433
parente4506330b411e8fa855c0f6a781ba66c2607c90e (diff)
parent26c69c5df8bf7800e16a2d12d207f2ae8779fb9e (diff)
downloadgitlab-ce-528c3e2b8d2d65257e489601220f34b918b80e17.tar.gz
Merge branch 'remove-u2f-error-logging' into 'master'
Display error code for U2F errors See merge request !7305
-rw-r--r--app/assets/javascripts/u2f/authenticate.js3
-rw-r--r--app/assets/javascripts/u2f/error.js1
-rw-r--r--app/assets/javascripts/u2f/register.js3
-rw-r--r--app/views/u2f/_authenticate.html.haml2
-rw-r--r--app/views/u2f/_register.html.haml2
-rw-r--r--changelogs/unreleased/remove-u2f-error-logging.yml4
6 files changed, 10 insertions, 5 deletions
diff --git a/app/assets/javascripts/u2f/authenticate.js b/app/assets/javascripts/u2f/authenticate.js
index d2aa3c7a841..e407b856e10 100644
--- a/app/assets/javascripts/u2f/authenticate.js
+++ b/app/assets/javascripts/u2f/authenticate.js
@@ -89,7 +89,8 @@
U2FAuthenticate.prototype.renderError = function(error) {
this.renderTemplate('error', {
- error_message: error.message()
+ error_message: error.message(),
+ error_code: error.errorCode
});
return this.container.find('#js-u2f-try-again').on('click', this.renderSetup);
};
diff --git a/app/assets/javascripts/u2f/error.js b/app/assets/javascripts/u2f/error.js
index 69f98c9c0ad..bb9942a3aa0 100644
--- a/app/assets/javascripts/u2f/error.js
+++ b/app/assets/javascripts/u2f/error.js
@@ -9,7 +9,6 @@
this.errorCode = errorCode;
this.message = bind(this.message, this);
this.httpsDisabled = window.location.protocol !== 'https:';
- console.error("U2F Error Code: " + this.errorCode);
}
U2FError.prototype.message = function() {
diff --git a/app/assets/javascripts/u2f/register.js b/app/assets/javascripts/u2f/register.js
index 4f5d68f546b..050c9bfc02e 100644
--- a/app/assets/javascripts/u2f/register.js
+++ b/app/assets/javascripts/u2f/register.js
@@ -76,7 +76,8 @@
U2FRegister.prototype.renderError = function(error) {
this.renderTemplate('error', {
- error_message: error.message()
+ error_message: error.message(),
+ error_code: error.errorCode
});
return this.container.find('#js-u2f-try-again').on('click', this.renderSetup);
};
diff --git a/app/views/u2f/_authenticate.html.haml b/app/views/u2f/_authenticate.html.haml
index 232ca26c1af..fa998c91f72 100644
--- a/app/views/u2f/_authenticate.html.haml
+++ b/app/views/u2f/_authenticate.html.haml
@@ -13,7 +13,7 @@
%script#js-authenticate-u2f-error{ type: "text/template" }
%div
- %p <%= error_message %>
+ %p <%= error_message %> (error code: <%= error_code %>)
%a.btn.btn-warning#js-u2f-try-again Try again?
%script#js-authenticate-u2f-authenticated{ type: "text/template" }
diff --git a/app/views/u2f/_register.html.haml b/app/views/u2f/_register.html.haml
index 8f7b42eb351..fcc33f04237 100644
--- a/app/views/u2f/_register.html.haml
+++ b/app/views/u2f/_register.html.haml
@@ -23,7 +23,7 @@
%script#js-register-u2f-error{ type: "text/template" }
%div
%p
- %span <%= error_message %>
+ %span <%= error_message %> (error code: <%= error_code %>)
%a.btn.btn-warning#js-u2f-try-again Try again?
%script#js-register-u2f-registered{ type: "text/template" }
diff --git a/changelogs/unreleased/remove-u2f-error-logging.yml b/changelogs/unreleased/remove-u2f-error-logging.yml
new file mode 100644
index 00000000000..edbe576a976
--- /dev/null
+++ b/changelogs/unreleased/remove-u2f-error-logging.yml
@@ -0,0 +1,4 @@
+---
+title: Display error code for U2F errors
+merge_request: 7305
+author: winniehell