# Как получить внешний ID

**URL:** <https://meta.discourse.org/t/how-to-get-external-id/258777>\
**Category:** Support\
**Created:** [20.Март.2023 18:30:00 UTC](https://meta.discourse.org/t/how-to-get-external-id/258777 "2023-03-20T18:30:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [20.Март.2023 18:53:09 UTC](https://meta.discourse.org/t/how-to-get-external-id/258777/2 "2023-03-20T18:53:09Z")

</div>

> [@Osman Görmüş](#):
>
> Как я могу получить внешний ID `currentUser` через JavaScript?

Похоже, вы пытаетесь получить `user_associated_account.provider_uid` пользователя. Судя по коду, есть скрытая настройка сайта, которую нужно включить, чтобы `associated_account_ids` возвращались из `CurrentUserSerializer`:

> <https://github.com/discourse/discourse/blob/main/app/serializers/current_user_serializer.rb#L242-L254>

Настройка `include_associated_account_ids` скрыта: [discourse/config/site\_settings.yml at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/config/site_settings.yml#L2078). Чтобы включить её, откройте консоль Rails вашего сайта и выполните:

`SiteSetting.include_associated_account_ids=true`

---

_[View the full topic](https://meta.discourse.org/t/how-to-get-external-id/258777)._
