mirror of
https://github.com/go-gitea/gitea.git
synced 2025-05-03 14:08:03 +00:00
Simplify secure context check (#33906)
As discussed in https://github.com/go-gitea/gitea/pull/33820/files#r1997532169.
This commit is contained in:
parent
52663113d4
commit
01c8f092a0
@ -11,14 +11,11 @@ export async function initUserAuthWebAuthn() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.location.protocol === 'http:') {
|
|
||||||
// webauthn is only supported on secure contexts
|
// webauthn is only supported on secure contexts
|
||||||
const isLocalhost = ['localhost', '127.0.0.1'].includes(window.location.hostname);
|
if (!window.isSecureContext) {
|
||||||
if (!isLocalhost) {
|
|
||||||
hideElem(elSignInPasskeyBtn);
|
hideElem(elSignInPasskeyBtn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!detectWebAuthnSupport()) {
|
if (!detectWebAuthnSupport()) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user