Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure timeout error is shown on u2f timeout #14417

Merged
merged 4 commits into from
Jan 22, 2021

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Jan 21, 2021

U2F timeout error is not currently shown due to miss match the '-' and '_' in the class names on u2f_error.tmpl

@6543 6543 added the type/bug label Jan 21, 2021
@@ -2243,7 +2243,7 @@ function u2fError(errorType) {
2: $('#u2f-error-2'),
3: $('#u2f-error-3'),
4: $('#u2f-error-4'),
5: $('.u2f-error-5')
5: $('.u2f_error_5')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this inconsistency really right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes look at line 29 in u2f_error.tmpl

Copy link
Member

@techknowlogick techknowlogick Jan 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be better to change L29 of the template to u2f-error-5 instead to retain consistency?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 21, 2021
@zeripath
Copy link
Contributor Author

I would argue we should rename these classes and the locale keys to match:

interface ErrorCode {
const short OK = 0;
const short OTHER_ERROR = 1;
const short BAD_REQUEST = 2;
const short CONFIGURATION_UNSUPPORTED = 3;
const short DEVICE_INELIGIBLE = 4;
const short TIMEOUT = 5;
};

from https://fidoalliance.org/specs/fido-u2f-v1.0-nfc-bt-amendment-20150514/fido-u2f-javascript-api.html

But that would not be backportable.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 21, 2021
@techknowlogick
Copy link
Member

mmm... yes, that would be much better. although as you said, not backportable. Lets save the refactor for another PR then. I'll create an issue for the refactor and tag it as "good-first-issue" in case someone is looking for a PR to ease their way into contributing to Gitea.

Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving per my latest comment.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 21, 2021
@6543
Copy link
Member

6543 commented Jan 22, 2021

🚀

@6543 6543 merged commit 20f980d into go-gitea:master Jan 22, 2021
@zeripath zeripath deleted the u2f-timeout-show-error branch January 22, 2021 17:27
zeripath added a commit to zeripath/gitea that referenced this pull request Jan 22, 2021
6543 added a commit that referenced this pull request Jan 23, 2021
Backport #14417

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: 6543 <[email protected]>
@6543 6543 added the backport/done All backports for this PR have been created label Jan 26, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants