# An error occurred at login modal (same as topic 293167)

**URL:** https://meta.discourse.org/t/an-error-occurred-at-login-modal-same-as-topic-293167/293720
**Category:** Bug
**Tags:** passkey
**Created:** [February 1, 2024, 12:38am UTC](https://meta.discourse.org/t/an-error-occurred-at-login-modal-same-as-topic-293167/293720 "2024-02-01T00:38:15Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [February 1, 2024, 12:38am UTC](https://meta.discourse.org/t/an-error-occurred-at-login-modal-same-as-topic-293167/293720/1 "2024-02-01T00:38:15Z")

</div>

I have noticed this bug before on Meta, but then it appeared on my deployments after the latest upgrade: when clicking login, the “Welcome back 👋” modal appears, and is immediately shadowed by “Sorry, an error occurred”. Clicking OK removes the error modal and you can resume authentication normally.

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/3/7/c375b36b25cba4726591991ec66c53b724115dfe.png)

There’s an error log in the console:

```plaintext
ajax-error.js:9:12
    l ajax-error.js:9
    p ajax-error.js:95
    passkeyLogin login.js:147

```

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [February 1, 2024, 12:38am UTC](https://meta.discourse.org/t/an-error-occurred-at-login-modal-same-as-topic-293167/293720/2 "2024-02-01T00:38:50Z")

</div>

Which browser do you use?

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [February 1, 2024, 12:40am UTC](https://meta.discourse.org/t/an-error-occurred-at-login-modal-same-as-topic-293167/293720/3 "2024-02-01T00:40:07Z")

</div>

Firefox 115.7.0esr (64-bit) on Debian 12.

ℹ Discourse v3.3.0.beta1-dev — [Commits · discourse/discourse · GitHub](https://github.com/discourse/discourse/commits/bfa3e056f1) — Ember v5.5.0

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [February 1, 2024, 12:41am UTC](https://meta.discourse.org/t/an-error-occurred-at-login-modal-same-as-topic-293167/293720/4 "2024-02-01T00:41:13Z")

</div>

Then I think it is the same issue as [Error message displaying at login with Linux/Firefox](https://meta.discourse.org/t/error-message-displaying-at-login-with-linux-firefox/293167)

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [February 1, 2024, 1:17am UTC](https://meta.discourse.org/t/an-error-occurred-at-login-modal-same-as-topic-293167/293720/5 "2024-02-01T01:17:43Z")

</div>

This is a regression introduced here: [FEATURE: Allow users to confirm session with passkeys (#24337) · discourse/discourse@c6ead3f · GitHub](https://github.com/discourse/discourse/commit/c6ead3f5c4de128592748d73acdb8c525730bc5b)

> <https://github.com/discourse/discourse/blob/c6ead3f5c4de128592748d73acdb8c525730bc5b/app/assets/javascripts/discourse/app/lib/webauthn.js#L136>

I think the code needs to be moved in the `try{}` below; otherwise, the error will use the UI instead of the console.

> <https://github.com/discourse/discourse/blob/c6ead3f5c4de128592748d73acdb8c525730bc5b/app/assets/javascripts/discourse/app/lib/webauthn.js#L173>

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [February 2, 2024, 9:40pm UTC](https://meta.discourse.org/t/an-error-occurred-at-login-modal-same-as-topic-293167/293720/7 "2024-02-02T21:40:55Z")

</div>

Thanks for the report. This should be fixed via [FIX: Handle old Firefox versions that do not support isConditionalMed… by pmusaraj · Pull Request #25549 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/25549), I could only repro with that version of Firefox on Windows/macOS, but the fix should apply to other OSs as well.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [February 6, 2024, 10:41pm UTC](https://meta.discourse.org/t/an-error-occurred-at-login-modal-same-as-topic-293167/293720/9 "2024-02-06T22:41:30Z")

</div>

This topic was automatically closed after 4 days. New replies are no longer allowed.
