# Runtime error login bug

**URL:** https://meta.discourse.org/t/runtime-error-login-bug/283678
**Category:** Bug
**Tags:** passkey
**Created:** [October 27, 2023, 1:05pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678 "2023-10-27T13:05:12Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 1:05pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/1 "2023-10-27T13:05:12Z")

</div>

Login (local login with email and password) is not responding because of the following runtime error:

```plaintext
**publickeycredential is not defined.**
passkeyConditionalLogin
installModifier
install
untrack
install

```

Everytime you click the login button that appears in the console.

Env: invite only, login only system. Trying to login as admin. THe only I can get in is with email containing a one time session link.

---

<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: [October 27, 2023, 1:43pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/5 "2023-10-27T13:43:16Z")

</div>

Thanks for the report, I will take a look. Which browser (or browsers) is this happening on, do you know?

---

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 1:45pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/6 "2023-10-27T13:45:13Z")

</div>

firefox (Tor). I will thank you so much if you can fix it!  
the setup again for reproducing: registered users only and invite only.

---

<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: [October 27, 2023, 2:04pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/7 "2023-10-27T14:04:01Z")

</div>

I can see an error as well in Firefox (not Chrome):

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/d/1/ad17e7328852e04d7622f4e112486a75033b938b.png)

---

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 2:05pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/8 "2023-10-27T14:05:49Z")

</div>

I thought I was going crazy! For me it was PublicKeyCredential is not defined. Are you also invite and login only?

---

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 3:02pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/9 "2023-10-27T15:02:30Z")

</div>

Any updates? its pretty disastrous for me

---

<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: [October 27, 2023, 3:04pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/10 "2023-10-27T15:04:24Z")

</div>

A fix is going to be merged soon 👍

[https://github.com/discourse/discourse/pull/24142](https://github.com/discourse/discourse/pull/24142)

---

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 3:07pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/11 "2023-10-27T15:07:49Z")

</div>

damn! thank you both and all who are fixing this. So then I run rebuild and it should be good , yeah? Or discourse-setup pulls from the repo too? Also I believe there is an error with the default onion template: the onion links redirects to the clearnet page and I have to run the doctor script becuase of some errors. I dont think it makes sense to manually turn off the redirect in nginx, since the rest of requests will still go through clearnet right?

---

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 3:09pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/12 "2023-10-27T15:09:19Z")

</div>

THANKS FOR THE COMMIT. When is it gonna be merged usually?

---

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 3:14pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/13 "2023-10-27T15:14:01Z")

</div>

Can I technically add those couple lines myself so I dont add more down time with rebuilding? Where is that app directory? And would launcher restart be enough?

---

<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: [October 27, 2023, 3:37pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/14 "2023-10-27T15:37:10Z")

</div>

> [@joerogan](#):
>
> When is it gonna be merged usually?

It’s coming, it’s coming. I just pushed a modification to the fix, it’s tricky because the passkeys’ conditional UI is unevenly supported by browsers.

There is an API to check if the feature is supported, described here: [PublicKeyCredential: isConditionalMediationAvailable() static method - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/isConditionalMediationAvailable), but the call to `isConditionalMediationAvailable()` behaves differently on different browsers.

In Firefox. it is completely unsupported. In Safari on iOS, the feature is supported, but calling `isConditionalMediationAvailable()` returns `false`… so I had to modify the code to add a feature check just for Firefox.

Once tests pass, I will merge the change, it should be then available in about an hour.

---

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 3:43pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/15 "2023-10-27T15:43:21Z")

</div>

thank yeah I saw the second commits… I am changing things locally so I wont rebuild right now and just restart container. It will work yeah? Did you just locally manually?

---

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 3:52pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/16 "2023-10-27T15:52:15Z")

</div>

I just added the changes and restarted the container, but it still does not work. I still get the Publickeycredentials is not defined error.

---

<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: [October 27, 2023, 3:58pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/17 "2023-10-27T15:58:22Z")

</div>

I just merged the PR, once it’s in `tests-passed`, you can rebuild and it should fix the issue. I was testing locally with TOR and Firefox on macOS.

Keep an eye on [GitHub - discourse/discourse at tests-passed · GitHub](https://github.com/discourse/discourse/tree/tests-passed), once the commit shows up there, you can rebuild.

---

<div class="post-metadata">

### Author: ![joerogan](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@joerogan](https://meta.discourse.org/u/joerogan)
#### Post date: [October 27, 2023, 4:03pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/18 "2023-10-27T16:03:53Z")

</div>

Do I have to rebuild? why is not working when I locally edit the files and run launcher restart? Because I just did exactly that

---

<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: [October 27, 2023, 4:39pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/19 "2023-10-27T16:39:48Z")

</div>

Because the changes you’re making are on the source files, you need to rebuild the assets.

---

<div class="post-metadata">

### Author: ![Rafael\_Melo\_Silva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rafael_melo_silva/32/298585_2.png) [@Rafael\_Melo\_Silva](https://meta.discourse.org/u/Rafael_Melo_Silva)
#### Post date: [October 27, 2023, 5:12pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/21 "2023-10-27T17:12:13Z")

</div>

How long will take to this update be official? My android app it’s showing that error

---

<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: [October 27, 2023, 5:15pm UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/22 "2023-10-27T17:15:59Z")

</div>

The fix is now merged, and I see it is deployed to [meta.discourse.org](http://meta.discourse.org), can you reproduce the issue here on your Android device? If so, please share browser version, thanks.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [October 31, 2023, 4:08am UTC](https://meta.discourse.org/t/runtime-error-login-bug/283678/24 "2023-10-31T04:08:06Z")

</div>


