# API Key just shows a "-" (dash)

**URL:** https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853
**Category:** Support
**Created:** [October 3, 2019, 7:39am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853 "2019-10-03T07:39:40Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Roemer](https://forum.syncthing.net/user_avatar/forum.syncthing.net/roemer/32/6185_2.png) [@Roemer](https://forum.syncthing.net/u/Roemer)
#### Post date: [October 3, 2019, 7:39am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/1 "2019-10-03T07:39:41Z")

</div>

Hey all

I have Syncthing running behind an nginx reverse proxy. If I access the web ui via the reverse proxy, the API Key always just shows a “-” but if I access the web ui directly, I can see the correct API Key. Is that a bug or a feature? If so, can I still show the API Key somehow when using a reverse proxy?

Thanks for your help Roman

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [October 3, 2019, 8:04am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/2 "2019-10-03T08:04:59Z")

</div>

We don’t do anything special based on who or how the config is requested (and that is where the API key lives), so I’m not sure.

---

<div class="post-metadata">

### Author: ![Roemer](https://forum.syncthing.net/user_avatar/forum.syncthing.net/roemer/32/6185_2.png) [@Roemer](https://forum.syncthing.net/u/Roemer)
#### Post date: [October 3, 2019, 9:17am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/3 "2019-10-03T09:17:47Z")

</div>

Strange. Is there some way I can debug this somehow?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [October 3, 2019, 10:15am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/4 "2019-10-03T10:15:01Z")

</div>

Check chrome developer tools to see what comes back from the rest calls, and see if there are any errors.

---

<div class="post-metadata">

### Author: ![Roemer](https://forum.syncthing.net/user_avatar/forum.syncthing.net/roemer/32/6185_2.png) [@Roemer](https://forum.syncthing.net/u/Roemer)
#### Post date: [October 3, 2019, 10:36am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/5 "2019-10-03T10:36:59Z")

</div>

Hmm in the config result I can see the correct api key. When loading the page, I get the following error when connecting via reverse proxy:

```
TypeError: Cannot read property 'user' of undefined
    at refreshNoAuthWarning (syncthingController.js:442)
    at syncthingController.js:423
    at angular.js:9452
    at processQueue (angular.js:13337)
    at angular.js:13353
    at Scope.$eval (angular.js:14589)
    at Scope.$digest (angular.js:14405)
    at Scope.$apply (angular.js:14694)
    at angular.js:14984
    at completeOutstandingRequest (angular.js:4959)

```

I don’t get that error when connecting directly.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [October 3, 2019, 10:38am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/6 "2019-10-03T10:38:33Z")

</div>

Try clearing your browser cache

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [October 3, 2019, 10:39am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/7 "2019-10-03T10:39:59Z")

</div>

It seems that CSRF or something is failing so some request must not be returning, check the network tab.

---

<div class="post-metadata">

### Author: ![Roemer](https://forum.syncthing.net/user_avatar/forum.syncthing.net/roemer/32/6185_2.png) [@Roemer](https://forum.syncthing.net/u/Roemer)
#### Post date: [October 3, 2019, 10:44am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/8 "2019-10-03T10:44:09Z")

</div>

It happens only in chrome, firefox works. Clearing the cache didn’t help. I only see http codes 200 or 304.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [October 3, 2019, 10:48am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/9 "2019-10-03T10:48:02Z")

</div>

Might be a race condition, the check happens before the config is loaded somehow, but yeah, no idea, you are on your own.

---

<div class="post-metadata">

### Author: ![Roemer](https://forum.syncthing.net/user_avatar/forum.syncthing.net/roemer/32/6185_2.png) [@Roemer](https://forum.syncthing.net/u/Roemer)
#### Post date: [October 3, 2019, 10:56am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/10 "2019-10-03T10:56:58Z")

</div>

I just saw that the error also happens when connecting without reverse proxy, but in that case, the api key is still filled. So this is something else.

---

<div class="post-metadata">

### Author: ![Roemer](https://forum.syncthing.net/user_avatar/forum.syncthing.net/roemer/32/6185_2.png) [@Roemer](https://forum.syncthing.net/u/Roemer)
#### Post date: [October 3, 2019, 11:07am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/11 "2019-10-03T11:07:58Z")

</div>

It seems to be some kind of race issue but strange that it always happen behind a reverse proxy.

---

<div class="post-metadata">

### Author: ![Nummer378](https://forum.syncthing.net/user_avatar/forum.syncthing.net/nummer378/32/5958_2.png) [@Nummer378](https://forum.syncthing.net/u/Nummer378)
#### Post date: [October 3, 2019, 11:51am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/12 "2019-10-03T11:51:16Z")

</div>

This probably isn’t of much help to you, but I also have the interface behind nginx and all is well on FF and Chrome.

But, I initially had repeated “Syncthing seems to be down” messages, until I adjusted some buffers and timeouts in my nginx config.

These are the relevant parts of my nginx config:

```
server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name ...
  ssl_certificate ... etc
  location / {
      add_header Strict-Transport-Security "max-age=31536000";
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_buffers 32 4m;
      proxy_busy_buffers_size 25m;
      proxy_buffer_size 512k;
      proxy_read_timeout 600s;
      proxy_send_timeout 600s;
      proxy_http_version 1.1;
      proxy_max_temp_file_size 0;
      proxy_pass http://127.0.0.1:8384/;
  }
}
```

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [November 2, 2019, 11:51am UTC](https://forum.syncthing.net/t/api-key-just-shows-a-dash/13853/13 "2019-11-02T11:51:18Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
