Auth token never refreshes - keep getting logged out in the middle of a session #7339

Closed
opened 2026-02-21 18:20:04 -05:00 by yindo · 1 comment
Owner

Originally created by @sugoh on GitHub (Dec 22, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.14.1

Cloud or Self Hosted

Cloud

Steps to reproduce

  1. Log into Dify Cloud
  2. Do some work for 1-2 hours
  3. Get logged out in the middle of a session

✔️ Expected Behavior

Auth token refreshes as long as there is user activity. Possibly up to a maximum of a few days before re-logging in is forced

Actual Behavior

  1. Get logged out in the middle of a session
  2. Takes >1 min 30 seconds to show the "re-log in" screen
  3. Sometimes get logged out faster than the rate limit for re-sending email OTP so I just get stuck
Originally created by @sugoh on GitHub (Dec 22, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.14.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce 1. Log into Dify Cloud 2. Do some work for 1-2 hours 3. Get logged out in the middle of a session ### ✔️ Expected Behavior Auth token refreshes as long as there is user activity. Possibly up to a maximum of a few days before re-logging in is forced ### ❌ Actual Behavior 1. Get logged out in the middle of a session 2. Takes >1 min 30 seconds to show the "re-log in" screen 3. Sometimes get logged out faster than the rate limit for re-sending email OTP so I just get stuck
yindo added the 🐞 bugstalecloud labels 2026-02-21 18:20:04 -05:00
yindo closed this issue 2026-02-21 18:20:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 22, 2024):

The issue you're experiencing with the authentication token not refreshing and causing unexpected logouts could be related to the token refresh mechanism in Dify. The current implementation involves verifying the refresh token, generating new tokens, and updating them in the Redis store [1]. However, there might be specific conditions or configurations in Dify Cloud that are affecting this process, such as session timeout settings or token expiration intervals, which are not detailed in the available information.

To address this issue, you might want to check the following:

  1. Token Expiration and Refresh Intervals: Ensure that the token expiration and refresh intervals are configured correctly in your Dify Cloud setup. Unfortunately, specific default settings for these intervals are not available in the provided information.

  2. Session Timeout Configuration: Verify if there is a session timeout or inactivity timeout configured that might be causing the session to end prematurely.

  3. Logging and Monitoring: Check if there are any logs or monitoring tools available that could provide insights into why the token refresh is failing or why the session is expiring unexpectedly.

If these checks do not resolve the issue, it might be necessary to look into the Dify Cloud configuration or reach out to the maintainers for further assistance.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Dec 22, 2024): <!-- Answer --> The issue you're experiencing with the authentication token not refreshing and causing unexpected logouts could be related to the token refresh mechanism in Dify. The current implementation involves verifying the refresh token, generating new tokens, and updating them in the Redis store <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/services/account_service.py)</sup>. However, there might be specific conditions or configurations in Dify Cloud that are affecting this process, such as session timeout settings or token expiration intervals, which are not detailed in the available information. To address this issue, you might want to check the following: 1. **Token Expiration and Refresh Intervals**: Ensure that the token expiration and refresh intervals are configured correctly in your Dify Cloud setup. Unfortunately, specific default settings for these intervals are not available in the provided information. 2. **Session Timeout Configuration**: Verify if there is a session timeout or inactivity timeout configured that might be causing the session to end prematurely. 3. **Logging and Monitoring**: Check if there are any logs or monitoring tools available that could provide insights into why the token refresh is failing or why the session is expiring unexpectedly. If these checks do not resolve the issue, it might be necessary to look into the Dify Cloud configuration or reach out to the maintainers for further assistance. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/71c76935-2982-408b-abfc-0bc62b68b9c8?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/71c76935-2982-408b-abfc-0bc62b68b9c8?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/71c76935-2982-408b-abfc-0bc62b68b9c8?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/71c76935-2982-408b-abfc-0bc62b68b9c8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/71c76935-2982-408b-abfc-0bc62b68b9c8?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/71c76935-2982-408b-abfc-0bc62b68b9c8?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7339