0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-25 08:11:19 +01:00
gitea/web_src/js/features
wxiaoguang 027014d7de
Fix webauthn regression and improve code (#25113)
Follow:

* #22697

There are some bugs in #22697:

* https://github.com/go-gitea/gitea/pull/22697#issuecomment-1577957966
* the webauthn failure message is never shown and causes console error
* The `document.getElementById('register-button')` and
`document.getElementById('login-button')` is wrong
    * there is no such element in code
    * it causes JS error when a browser doesn't provide webauthn
    * the end user can't see the real error message

These bugs are fixed in this PR.

Other changes:

* Use simple HTML/CSS layouts, no need to use too many `gt-` patches
* Make the webauthn page have correct "page-content" layout
* The "data-webauthn-error-msg" elements are only used to provide locale
texts, so move them into a single "gt-hidden", then no need to repeat a
lot of "gt-hidden" in code
* The `{{.CsrfTokenHtml}}`  is a no-op because there is no form
* Many `hideElem('#webauthn-error')` in code is no-op because the
`webauthn-error` already has "gt-hidden" by default
* Make the tests for "URLEncodedBase64" really test with concrete cases.


Screenshots:

* Error message when webauthn fails (before, there is no error message):

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/93cf9559-d93b-4f06-9d98-0f7032d9c65b)

</details>

* Error message when webauthn is unavailable 

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/ffc0fcd9-b93b-4418-979c-c89bb627aaf2)

</details>
2023-06-07 19:20:18 +08:00
..
admin
comp Improve and fix bugs surrounding reactions (#24760) 2023-05-28 01:34:18 +00:00
captcha.js
citation.js
clipboard.js
codeeditor.js Improve "goto issue by number" button (#24577) 2023-05-10 15:50:58 +00:00
colorpicker.js
common-global.js Support Copy Link for video attachments (#24833) 2023-05-21 22:06:17 +00:00
common-issue-list.js Improve "goto issue by number" button (#24577) 2023-05-10 15:50:58 +00:00
common-issue-list.test.js Improve "goto issue by number" button (#24577) 2023-05-10 15:50:58 +00:00
common-organization.js
contextpopup.js
copycontent.js Add two eslint plugins (#24776) 2023-05-18 09:14:31 +08:00
dropzone.js
emoji.js
eventsource.sharedworker.js
file-fold.js
heatmap.js
imagediff.js
install.js
notification.js Rework notifications list (#24812) 2023-05-25 02:31:26 +00:00
org-team.js Add status indicator on main home screen for each repo (#24638) 2023-05-13 21:59:01 +00:00
pull-view-file.js Improve accessibility when (re-)viewing files (#24817) 2023-05-21 20:47:41 +00:00
repo-branch.js Display warning when user try to rename default branch (#24512) 2023-05-04 22:54:38 +00:00
repo-code.js Improve and fix bugs surrounding reactions (#24760) 2023-05-28 01:34:18 +00:00
repo-code.test.js
repo-commit.js
repo-common.js
repo-diff-filetree.js
repo-diff.js Refactor diffFileInfo / DiffTreeStore (#24998) 2023-05-30 18:53:15 +08:00
repo-editor.js
repo-findfile.js
repo-findfile.test.js
repo-graph.js
repo-home.js
repo-issue-content.js Improve and fix bugs surrounding reactions (#24760) 2023-05-28 01:34:18 +00:00
repo-issue-list.js Add the ability to pin Issues (#24406) 2023-05-25 15:17:19 +02:00
repo-issue-pr-form.js
repo-issue.js Improve accessibility when (re-)viewing files (#24817) 2023-05-21 20:47:41 +00:00
repo-legacy.js Improve and fix bugs surrounding reactions (#24760) 2023-05-28 01:34:18 +00:00
repo-migrate.js Make repo migration cancelable and fix various bugs (#24605) 2023-05-11 08:25:46 +00:00
repo-migration.js
repo-projects.js Add two eslint plugins (#24776) 2023-05-18 09:14:31 +08:00
repo-release.js Update JS dependencies, add new eslint rules (#24597) 2023-05-09 02:35:49 +00:00
repo-settings.js Support for status check pattern (#24633) 2023-05-17 16:11:13 +08:00
repo-template.js Add status indicator on main home screen for each repo (#24638) 2023-05-13 21:59:01 +00:00
repo-unicode-escape.js Improve accessibility when (re-)viewing files (#24817) 2023-05-21 20:47:41 +00:00
repo-wiki.js Fix EasyMDE toolbar (#24489) 2023-05-03 01:23:39 -04:00
sshkey-helper.js
stopwatch.js
tablesort.js
tribute.js
user-auth-webauthn.js Fix webauthn regression and improve code (#25113) 2023-06-07 19:20:18 +08:00
user-auth.js Fix OAuth loading state (#24788) 2023-05-18 11:50:11 +00:00
user-settings.js