リクエストごとにリフレッシュする設定を加えているのですが、なぜか空でリターンされることが有りました
![](https://mokubo.website/wp-content/uploads/2021/01/Screen-Shot-2021-01-14-at-23.09.08-644x408.png)
調べてみると、どうやらリフレッシュされないときはそもそも更新していないから
らしいです
一応設定のファイル(initializers/devise_token_auth
)を確認したら、同じタイミングでAPIにリクエストする必要がある場合も有りますと、その場合は同じtokenでリクエストOKです、的なことが書いてます。
おそらく設定を加えたら色々とできるんでしょうけど、多分デフォルトでは10.seconds
なんだと思います
# Sometimes it's necessary to make several requests to the API at the same
# time. In this case, each request in the batch will need to share the same
# auth token. This setting determines how far apart the requests can be while
# still using the same auth token.
# config.batch_request_buffer_throttle = 10.seconds