-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Run detectWebAuthnSupport
only on sign-in page
#31676
Run detectWebAuthnSupport
only on sign-in page
#31676
Conversation
@@ -5,6 +5,10 @@ import {GET, POST} from '../modules/fetch.ts'; | |||
const {appSubUrl} = window.config; | |||
|
|||
export async function initUserAuthWebAuthn() { | |||
if (!document.querySelector('.user.signin')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is not right because link_account
also uses signin_inner
But I guess some logic has been broken for a while.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add a data-page="user-signin"
attribute to <body>
at some point to clearly indicate the which page we are on instead of relying on these flimsy selectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you serious? I am talking the logic bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess next time put a negative review, because otherwise, every PR runs danger of being merged too hastily.
And yes, my remark was just some idea for the future, but apparently @techknowlogick had read it incorrectly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to the suggestion that we should add a page attribute rather than relying on the selectors. I think that this PR is a way to reduce the scope of the bug significantly while we do that refactor.
Yes, that was just a suggestion for the future. But if the webauthn code incorrectly runs on the |
It is NOT "incorrectly runs on the |
* giteaofficial/main: use nolyfill to remove some polyfills (go-gitea#31468) Properly filter issue list given no assignees filter (go-gitea#31522) Run `detectWebAuthnSupport` only on sign-in page (go-gitea#31676) fix OIDC introspection authentication (go-gitea#31632) Enable direnv (go-gitea#31672) [skip ci] Updated translations via Crowdin [skip ci] Updated translations via Crowdin
@wxiaoguang I think I got your point, the selector is wrong. It will cause skipping |
Follow #31676, which is not correct, see #31676 (comment) Fix #31675, regression of #31504.
Fix #31675, regression of #31504.