Ho notato questo bug in precedenza su Meta, ma poi è apparso nei miei deployment dopo l’ultimo aggiornamento: facendo clic su login, appare la modale “Welcome back ”, che viene immediatamente oscurata da “Sorry, an error occurred”. Facendo clic su OK, la modale di errore viene rimossa e l’autenticazione può proseguire normalmente.
C’è un log di errore nella console:
ajax-error.js:9:12
l ajax-error.js:9
p ajax-error.js:95
passkeyLogin login.js:147
2 Mi Piace
Firefox 115.7.0esr (64-bit) su Debian 12.
Discourse v3.3.0.beta1-dev — Commits · discourse/discourse · GitHub — Ember v5.5.0
1 Mi Piace
Moin
1 Febbraio 2024, 12:41am
4
2 Mi Piace
Questa è una regressione introdotta qui: FEATURE: Allow users to confirm session with passkeys (#24337) · discourse/discourse@c6ead3f · GitHub
) {
if (!isWebauthnSupported()) {
return errorCallback(I18n.t("login.security_key_support_missing_error"));
}
// we need to check isConditionalMediationAvailable for Firefox
// without it, Firefox will throw console errors
// We cannot do a general check because iOS Safari and Chrome in Selenium quietly support the feature
// but they do not support the PublicKeyCredential.isConditionalMediationAvailable() method
if (mediation === "conditional" && isFirefox) {
const isCMA = await PublicKeyCredential.isConditionalMediationAvailable();
if (!isCMA) {
return;
}
}
try {
const resp = await ajax("/session/passkey/challenge.json");
const credential = await navigator.credentials.get({
publicKey: {
Penso che il codice debba essere spostato nel try{} sottostante; altrimenti, l’errore utilizzerà l’interfaccia utente invece della console.
userHandle: bufferToBase64(credential.response.userHandle),
};
} catch (error) {
if (error.name === "AbortError") {
// no need to show an error when the cancelling a pending ceremony
// this happens when switching from the conditional method (username input autofill)
// to the optional method (login button) or vice versa
return null;
}
if (mediation === "conditional") {
// The conditional method gets triggered in the background
// it's not helpful to show errors for it in the UI
// eslint-disable-next-line no-console
console.error(error);
return null;
}
if (error.name === "NotAllowedError") {
return errorCallback(I18n.t("login.security_key_not_allowed_error"));
} else if (error.name === "SecurityError") {
4 Mi Piace
pmusaraj
(Penar Musaraj)
2 Febbraio 2024, 9:40pm
7
Grazie per la segnalazione. Questo dovrebbe essere risolto tramite FIX: Handle old Firefox versions that do not support isConditionalMed… by pmusaraj · Pull Request #25549 · discourse/discourse · GitHub , sono riuscito a riprodurlo solo con quella versione di Firefox su Windows/macOS, ma la correzione dovrebbe applicarsi anche ad altri sistemi operativi.
3 Mi Piace
pmusaraj
(Penar Musaraj)
Chiuso
6 Febbraio 2024, 10:41pm
9
Questo argomento è stato chiuso automaticamente dopo 4 giorni. Non sono più consentite nuove risposte.