这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@timothycarambat
Copy link
Member

@timothycarambat timothycarambat commented Mar 22, 2024

When using AnythingLLM with a password or multi-user auth state the default token expiry is set to 30 days expiration (TBD custom config for this value).

If you are logged in and do not re-visit the system for some time where the token then expires on revisit the token will fail to verify and will return a null value, which will fatally crash the bcrypt compareHash function. Passing an empty '' instead when invalid will then cause an infinite re-render on the login screen.

Additional work was required to have this work when the session is fully expired:

  • Invalidate token as normal
  • Send the user to log in, but prevent auto login via a query param set during redirect due to invalid auth.
  • User can log in again and get a new session token.

  • Tested as all roles in multi-user
  • Tested with just password
  • Tested with no password instance

resolves #947

@timothycarambat timothycarambat merged commit efe9dfa into master Mar 26, 2024
@timothycarambat timothycarambat deleted the catch-fatal-hash-comparison branch March 26, 2024 23:47
cabwds pushed a commit to cabwds/anything-llm that referenced this pull request Jul 3, 2025
…ex-Labs#956)

* handle expired token being null and prevent constant rerender

* reset defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Crash when navigating to localhost.

2 participants