BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
eb7553c4
Commit
eb7553c4
authored
Jan 19, 2017
by
Fatih Acet
Committed by
James Lopez
Jan 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '26066-wrong-messsage-for-unregistered-u2f-device-on-sign-in' into 'master'
New U2F ineligible message Closes #26066 See merge request !8392
parent
90305d5a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
authenticate.js.es6
app/assets/javascripts/u2f/authenticate.js.es6
+1
-1
error.js
app/assets/javascripts/u2f/error.js
+8
-8
register.js
app/assets/javascripts/u2f/register.js
+1
-1
No files found.
app/assets/javascripts/u2f/authenticate.js.es6
View file @
eb7553c4
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
return function(response) {
return function(response) {
var error;
var error;
if (response.errorCode) {
if (response.errorCode) {
error = new U2FError(response.errorCode);
error = new U2FError(response.errorCode
, 'authenticate'
);
return _this.renderError(error);
return _this.renderError(error);
} else {
} else {
return _this.renderAuthenticated(JSON.stringify(response));
return _this.renderAuthenticated(JSON.stringify(response));
...
...
app/assets/javascripts/u2f/error.js
View file @
eb7553c4
...
@@ -5,21 +5,21 @@
...
@@ -5,21 +5,21 @@
var
bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
};
var
bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
};
this
.
U2FError
=
(
function
()
{
this
.
U2FError
=
(
function
()
{
function
U2FError
(
errorCode
)
{
function
U2FError
(
errorCode
,
u2fFlowType
)
{
this
.
errorCode
=
errorCode
;
this
.
errorCode
=
errorCode
;
this
.
message
=
bind
(
this
.
message
,
this
);
this
.
message
=
bind
(
this
.
message
,
this
);
this
.
httpsDisabled
=
window
.
location
.
protocol
!==
'https:'
;
this
.
httpsDisabled
=
window
.
location
.
protocol
!==
'https:'
;
this
.
u2fFlowType
=
u2fFlowType
;
}
}
U2FError
.
prototype
.
message
=
function
()
{
U2FError
.
prototype
.
message
=
function
()
{
switch
(
false
)
{
if
(
this
.
errorCode
===
u2f
.
ErrorCodes
.
BAD_REQUEST
&&
this
.
httpsDisabled
)
{
case
!
(
this
.
errorCode
===
u2f
.
ErrorCodes
.
BAD_REQUEST
&&
this
.
httpsDisabled
):
return
'U2F only works with HTTPS-enabled websites. Contact your administrator for more details.'
;
return
"U2F only works with HTTPS-enabled websites. Contact your administrator for more details."
;
}
else
if
(
this
.
errorCode
===
u2f
.
ErrorCodes
.
DEVICE_INELIGIBLE
)
{
case
this
.
errorCode
!==
u2f
.
ErrorCodes
.
DEVICE_INELIGIBLE
:
if
(
this
.
u2fFlowType
===
'authenticate'
)
return
'This device has not been registered with us.'
;
return
"This device has already been registered with us."
;
if
(
this
.
u2fFlowType
===
'register'
)
return
'This device has already been registered with us.'
;
default
:
return
"There was a problem communicating with your device."
;
}
}
return
"There was a problem communicating with your device."
;
};
};
return
U2FError
;
return
U2FError
;
...
...
app/assets/javascripts/u2f/register.js
View file @
eb7553c4
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
return
function
(
response
)
{
return
function
(
response
)
{
var
error
;
var
error
;
if
(
response
.
errorCode
)
{
if
(
response
.
errorCode
)
{
error
=
new
U2FError
(
response
.
errorCode
);
error
=
new
U2FError
(
response
.
errorCode
,
'register'
);
return
_this
.
renderError
(
error
);
return
_this
.
renderError
(
error
);
}
else
{
}
else
{
return
_this
.
renderRegistered
(
JSON
.
stringify
(
response
));
return
_this
.
renderRegistered
(
JSON
.
stringify
(
response
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment